Пример #1
0
 @Override
 public boolean touchDown(int x, int y, int x1, int y1) {
   super.touchDown(x, y, x1, y1);
   Log.debug("LiveMode.touchDown", "x=" + x + " y=" + y);
   CollideCallback callback = new CollideCallback();
   screen
       .getWorld()
       .QueryAABB(
           callback,
           coordinates.x - .01f,
           coordinates.y - .01f,
           coordinates.x + .01f,
           coordinates.y + .01f);
   lastTouchPolygon = callback.getBody();
   if (lastTouchPolygon != null) {
     lastTouchCoordinates = new Vector2(coordinates.x, coordinates.y);
     lastTouchPolygonLocalCoordinates = lastTouchPolygon.getLocalPoint(lastTouchCoordinates);
     Log.log(
         "LiveMode.touchDown",
         "touched world coords: "
             + lastTouchCoordinates
             + " touched poly local coords: "
             + lastTouchPolygonLocalCoordinates);
   }
   return false;
 }
Пример #2
0
 @Override
 public boolean touchDown(int x, int y, int x1, int y1) {
   super.touchDown(x, y, x1, y1);
   Gdx.app.debug("PathMode.touchDown", "x=" + x + " y=" + y);
   GDXPath path = screen.getLevel().getClosestPath(coordinates.x, coordinates.y);
   if (Gdx.input.isKeyPressed(Keys.CONTROL_LEFT)
       || path == null
       || path.getClosestNode(coordinates.x, coordinates.y).dst(coordinates.x, coordinates.y)
           > LevelEditorScreen.getNodeRadius()) path = new GDXPath();
   if (pathWindow == null)
     screen.getStage().addActor(pathWindow = new PathWindow(screen.getSkin(), this, path));
   if (path.getNodes().isEmpty()) pathWindow.add(coordinates.cpy());
   return false;
 }
Пример #3
0
 @Override
 public void loadLevel(GDXLevel level) {
   super.loadLevel(level);
   for (GDXSound npc : level.getSounds()) addSound(npc);
 }
Пример #4
0
 @Override
 public void start() {
   super.start();
   soundWindow = new SoundWindow(screen.getSkin(), screen.getLevel().getSounds(), this, screen);
   screen.getStage().addActor(soundWindow);
 }
Пример #5
0
 @Override
 public void start() {
   super.start();
   screen.getStage().addActor(window = new LiveWindow(screen.getSkin()));
   screen.setLive(true);
 }
Пример #6
0
 @Override
 public void loadLevel(GDXLevel level) {
   super.loadLevel(level);
   for (GDXPath npc : level.getPaths()) addPath(npc);
 }