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