@Test public void testComputeBottomLeft() throws Exception { PositionAnchor theAnchor = PositionAnchor.BOTTOM_LEFT; Size theScreenSize = new Size(320, 200); Position thePosition = new Position(10,10); Position thePositionOnScreen = theAnchor.compute(thePosition, new Position(15, 15), theScreenSize); assertEquals(10f, thePositionOnScreen.x, 0); assertEquals(190f, thePositionOnScreen.y, 0); }
public abstract Position compute(Position aWorldPosition, Position aCameraPosition, Size aScreenSize);
PositionAnchor { public abstract Position compute(Position aWorldPosition, Position aCameraPosition, Size aScreenSize); }
PositionAnchor { public abstract Position compute(Position aWorldPosition, Position aCameraPosition, Size aScreenSize); private  PositionAnchor(String aName); }
PositionAnchor { public abstract Position compute(Position aWorldPosition, Position aCameraPosition, Size aScreenSize); private  PositionAnchor(String aName); String name(); @Override String toString(); abstract Position compute(Position aWorldPosition, Position aCameraPosition, Size aScreenSize); static PositionAnchor valueOf(String aName); static PositionAnchor[] values(); }
PositionAnchor { public abstract Position compute(Position aWorldPosition, Position aCameraPosition, Size aScreenSize); private  PositionAnchor(String aName); String name(); @Override String toString(); abstract Position compute(Position aWorldPosition, Position aCameraPosition, Size aScreenSize); static PositionAnchor valueOf(String aName); static PositionAnchor[] values(); static final PositionAnchor SCENE; static final PositionAnchor CENTER; static final PositionAnchor PERCENT; static final PositionAnchor TOP_LEFT; static final PositionAnchor TOP_RIGHT; static final PositionAnchor BOTTOM_LEFT; static final PositionAnchor BOTTOM_RIGHT; }