Exemple #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);
  }
Exemple #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());
  }
Exemple #3
0
 protected void pointerDragged(int x, int y) {
   kinetic.pointerDragged(x, y);
 }
Exemple #4
0
 protected void pointerReleased(int x, int y) {
   closeButton.pointerReleased(x, y);
   kinetic.pointerReleased(x, y);
 }
Exemple #5
0
 protected void logic() {
   kinetic.logic();
 }