From: Erik V. <eri...@xs...> - 2011-06-06 10:10:46
|
Bill, Thanks. I tried it, and if it works, it works well. But I'm getting frequent crashes, so it's again a mixed success. I like your approach to hex highlighting, and will keep it in mind. As you will see in another mail, I'm already having good results with the Batik JSVGCanvas approach, and will certainly pursue that further. I'm not sure if it will turn out to be easy to incorporate tile drawing into that canvas too; if not, I might just copy your red hexagon code for the time being. I'm doubting where to put such maps. I created a separate <svnroot>/maps tree, whereas you have put it into <svnroot>/data/18EU. Perhaps the latter makes more sense. Erik. > -----Oorspronkelijk bericht----- > Van: Bill Rosgen [mailto:ro...@gm...] > Verzonden: maandag 6 juni 2011 8:30 > Aan: Erik Vos > Onderwerp: Re: [Rails-devel] 18EU: Background Map submission (revised > version) > > Erik, > > Here are the full text versions of the files I changed. I didn't implement much > more than just drawing the map. There is a little progress towards changing > the interface to make it work better with a SVG map, but it still needed some > work. In particular, the goal was to avoid drawing a red and then white > hexagon to highlight a tile (and then cover this with a tile), since it seemed > both costly and annoying to try to redraw a hexagonal portion of the base > map. > > Essentially I just created a new class GUIMapImage that parrots the code in > GUITile used to draw tiles (and put a new class in ImageLoader to handle > loading the map file). I also had to make some (minor) changes to HexMap > and the other classes to draw the map, but nothing really exciting. This code > is also still full of magic numbers and hardcoded strings, as I hadn't gotten to > implementing any of this in the XML (i.e. path to the map file, the scale, and x > and y offsets for the map). > > I don't imagine that there is that much of interest in these files, but now you > have them. I agree with the suggestion of handing off more of the image > processing to libraries, but haven't looked into it at all. > > The files included in this tarball are: > > rails/ui/swing/ImageLoader.java > > rails/ui/swing/hexmap/GUIHex.java > rails/ui/swing/hexmap/GUIMapImage.java > rails/ui/swing/hexmap/GUITile.java > rails/ui/swing/hexmap/HexMap.java > > data/18EU/MapImage.svg > > Bill |