예제 #1
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());
  }