public TripleDemo (Platform plat) { super(plat, 25); // update our "simulation" 40 times per second game = this; // jam ourselves into a global variable, woo! new Pointer(plat, rootLayer, true); // wire up event dispatch screens.push(new DemoMenuScreen(screens)); // start off with our menu screen // show debug rectangles when D key is pressed; dump scene graph on shift-D plat.input().keyboardEvents.collect(Keyboard.isKey(Key.D)).connect(event -> { Layer.DEBUG_RECTS = event.down; if (event.down && event.isShiftDown()) { rootLayer.debugPrint(plat.log()); } }); } }
ui = new UI(this); pointer = new Pointer(plat, rootLayer, true); input.touchEvents.connect(new playn.scene.Touch.Dispatcher(rootLayer, true)); input.mouseEvents.connect(new playn.scene.Mouse.Dispatcher(rootLayer, true));