From: Brett L. <wak...@ea...> - 2005-09-29 23:24:13
|
>>> Argh. I really gotta stop using Java 1.5 on my systems. I >>> apologize for that. >>> >>> What do you mean by the tiles being clipped? >>That the borders are not visible, only the center part. >>Or is that specific to me? >>I can't believe that *that* is caused by Java version >>differences, but you never know.... >Ahh... I'm pretty sure I know what that is. >In the paint() method for each GUIHex, you'll notice a call to g2.setClip(hexagon) >This sets the clipping boundary for each hex to be the size and dimensions >of the hexagon. This is probably cutting out the borders on the hexes. >However, the reason we need to setClip() is because otherwise the >clickable area for each hexagon would be a bunch of overlapping >rectangles that cause problems for detecting which hex a click triggers. Actually, I've found a better way of doing things. In GUIHex, there's still the PaintOverlay code from Colossus. This seems to work a lot better than my rather hackish image loading code. It currently only works under the NS hex orientation. If I can get the rotation math correct I'll have it working for all hexes shortly. ---Brett. |