예제 #1
0
  private void render() {
    g.setColor(0xffffffff);
    g.fillRect(0, 0, getWidth(), getHeight());
    g.drawImage(
        background, -kinetic.getWindowX(), -kinetic.getWindowY(), Graphics.LEFT | Graphics.TOP);
    g.drawImage(
        background,
        -kinetic.getWindowX(),
        background.getHeight() - kinetic.getWindowY(),
        Graphics.LEFT | Graphics.TOP);
    closeButton.render(g);

    kinetic.renderDebugData(g);
  }
예제 #2
0
  private void init() {
    closeButton =
        new ImageButton("/cross.png") {
          public void onSelected() {
            Main.getInstance().exit();
          }
        };
    closeButton.setX(getWidth() - closeButton.getWidth() - 5);
    closeButton.setY(5);

    try {
      background = ImageFactory.getInstance().getImage("/lorem.png");
    } catch (IOException io) {
    }

    kinetic =
        new Kinetic() {
          protected int offsetDecrement(int offset) {
            return 99 * offset / 100;
          }
        };
    kinetic.setMaxOffset(
        background.getWidth() - getWidth(), 2 * background.getHeight() - getHeight());
  }
예제 #3
0
 protected void pointerReleased(int x, int y) {
   closeButton.pointerReleased(x, y);
   kinetic.pointerReleased(x, y);
 }