From: Brett L. <wak...@ea...> - 2005-09-22 21:48:04
|
Before you get started, do one more checkout from CVS. I've just committed some extra code that does *very* rudimentary rotations based on values I observed. I'm working out the math to improve the calculations, but this works for now. I've moved around which class is implementing MouseListener a bit. This has cleared up a lot of confusion (for me). And now, clicking a hex will rotate it. There's a ton of bugs with the rotation still, but the basic mechanism works. I've been squashing repaint bugs as I find them. Some of them won't go away until we have tile rotation locked down a bit better. You're correct that af.rotate does the rotation, but you'll want to investigate the AffineTransform class documentation to see exactly how it's being rotated. The reason being, we're actually rotating a square image of a hexagon, which causes a little weirdness and is mathematically different than just rotating a hexagon. You'll see the reason af.rotate starts at 0.5 if you open any of the tile image files in any graphics program. ---Brett. -----Original Message----- From: Erik Vos <eri...@hc...> Sent: Sep 22, 2005 2:23 PM To: rai...@li... Subject: RE: [Rails-devel] Tiles are working... sorta. One little problem: My version of java (1.4.2) does not have AffineTransformOp.TYPE_BICUBIC, I have replaced it for now by AffineTransformOp.TYPE_BILINEAR. Another problem is that the map does not repaint correctly when the window regains focus. How are we going to specify rotation? I suggest to add an extra int argument to the GUIEWHex constructor, which can range from 0-5 which indicates the number of 60 degrees clockwise turns to get at the actual orientation. I suppose af.rotate() does the turning? Why is it 0.5 now? Not clear to me how to tweak it to get our 60/120/180 deg rotations. I'm now going add the rotations to the 1830 hex map based on the current output. Erik. > -----Original Message----- > From: rai...@li... > [mailto:rai...@li...] On Behalf Of > Brett Lentz > Sent: 22 September 2005 00:24 > To: rai...@li... > Subject: RE: [Rails-devel] Tiles are working... sorta. > > Sounds fine by me. I hope seeing the fully drawn game maps > is at least a little inspiring. ;-) > > I've added an ImageLoader class so that we only load tile > images once rather than reread every file for every repaint. > Currently it's instantiated in HexMap, but I'm not > completely certain it will be able to stay there. It might > need to move to MapManager or some other place. > > I've added a BufferedImage and AffineTransform to GUIHex. > This is where we'll control the image's rotation and scaling. > > I've mentioned previously that I've added a Paint() method to > GUIEWHex that extends the Paint() method in GUIHex. This > will contain the hard-coded numbers for rotation and scaling. > > > > ---Brett. > > > > -----Original Message----- > From: Erik Vos <eri...@hc...> > Sent: Sep 21, 2005 3:08 PM > To: rai...@li... > Subject: RE: [Rails-devel] Tiles are working... sorta. > > > Things that aren't working yet: > > > > 1. We haven't defined the hex orientation in map.xml, so some > > of the map tiles aren't rotated properly. > > That I had planned to do when tiles would be displayable: > trying out the right rotation codes by trial and error (!). > So now is the time to start working on that. > > > 2. There's a few different things causing huge performance > > hits for drawing all tiles. > > > > 3. There's currently no interactivity with the map. > > > > Soon we'll need to build the logic for rotating through legal > > tiles. Is there already a method defined for obtaining arrays > > of tiles, such as an array of all yellow tile IDs? > > No, Tiles.xml is not read yet. But I think this file has the necessary > ingredients to create an internal representation of each tile's > nodes and tracks in terms of objects and relations between objects > (although I have some vague ideas on how it could be done). > > I'll look at what you have now tomorrow, maybe it inspires me to > something.... > > Erik. > > > > > ------------------------------------------------------- > SF.Net email is sponsored by: > Tame your development challenges with Apache's Geronimo App > Server. Download > it for free - -and be entered to win a 42" plasma tv or your very own > Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php > _______________________________________________ > Rails-devel mailing list > Rai...@li... > https://lists.sourceforge.net/lists/listinfo/rails-devel > > > > ------------------------------------------------------- > SF.Net email is sponsored by: > Tame your development challenges with Apache's Geronimo App > Server. Download > it for free - -and be entered to win a 42" plasma tv or your very own > Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php > _______________________________________________ > Rails-devel mailing list > Rai...@li... > https://lists.sourceforge.net/lists/listinfo/rails-devel > > ------------------------------------------------------- SF.Net email is sponsored by: Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php _______________________________________________ Rails-devel mailing list Rai...@li... https://lists.sourceforge.net/lists/listinfo/rails-devel |