ch.sahits.game.graphic.display.util
Class ClickableOffsetPolygons

java.lang.Object
  extended by ch.sahits.game.graphic.display.util.ClickablePolygons
      extended by ch.sahits.game.graphic.display.util.ClickableOffsetPolygons

public class ClickableOffsetPolygons
extends ClickablePolygons

This specialisation of the ClickablePolygons class provides a test method for a given Y-Offset. The polygons are defined by forms on an image. The image may however be moved by an offset in the y direction. This offset must be considered when checking against the polygons.

Author:
Andi Hotz, (c) Sahits GmbH, 2011 Created on Dec 19, 2011

Constructor Summary
ClickableOffsetPolygons()
           
 
Method Summary
 void testAndExecute(Point p, int yOffset)
          Find the polygon that contains the point and if such a polygon exists execute its action
 
Methods inherited from class ch.sahits.game.graphic.display.util.ClickablePolygons
add, testAndExecute, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ClickableOffsetPolygons

public ClickableOffsetPolygons()
Method Detail

testAndExecute

public void testAndExecute(Point p,
                           int yOffset)
Find the polygon that contains the point and if such a polygon exists execute its action

Parameters:
p - coordinates clicked on the screen
yOffset - offset the underling image is scrolled in y direction


Copyright © 2011-2012 Sahits GmbH. All Rights Reserved.