Package ch.sahits.game.graphic.display.util

Examples of ch.sahits.game.graphic.display.util.OffsetCalculator


  /**
   * Setting the positions of the polygons on the screen
   */
  private void initPortPolygons(double scale,Rectangle bounds) {
    // TODO implement PolygonLoader
    OffsetCalculator offsetter = new OffsetCalculator(getBounds().x+bounds.x, getBounds().y+bounds.y); // top left corner of this view plus any black borders
    NamedPolygon poly = new NamedPolygon(polyNames[0]);
    poly.addPoint(offsetter.computeXOffset(508, scale), offsetter.computeYOffset(678, scale));
    poly.addPoint(offsetter.computeXOffset(574, scale), offsetter.computeYOffset(520, scale));
    poly.addPoint(offsetter.computeXOffset(534, scale), offsetter.computeYOffset(546, scale));
    poly.addPoint(offsetter.computeXOffset(736, scale), offsetter.computeYOffset(586, scale));
    poly.addPoint(offsetter.computeXOffset(702, scale), offsetter.computeYOffset(672, scale));
    poly.addPoint(offsetter.computeXOffset(786, scale), offsetter.computeYOffset(758, scale));
    poly.addPoint(offsetter.computeXOffset(526, scale), offsetter.computeYOffset(756, scale));
    int meanY = (poly.ypoints[1] + poly.ypoints[5]) / 2;
    portPolygons.put(meanY, poly); // maybe we should use meanX instead
  }
View Full Code Here


  protected void initOffsets() {
    int h = images.get(0).getHeight();
    int w = images.get(0).getWidth();
    // PaperScroll
    Point offset = new Point(size.width - (w + 150), size.height - h);
    offsetter = new OffsetCalculator(size.width - (w + 150),
        size.height - h);
    offsets.put(names[0], offset);
//    // Offset for the quill
//    // same x as paper scroll
//    // y such that the bottom border aligns with the window
View Full Code Here

TOP

Related Classes of ch.sahits.game.graphic.display.util.OffsetCalculator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.