Class MapView

java.lang.Object
arc.scene.Element
mindustry.editor.MapView
All Implemented Interfaces:
GestureDetector.GestureListener

public class MapView extends Element implements GestureDetector.GestureListener
  • Constructor Details

    • MapView

      public MapView()
  • Method Details

    • getTool

      public EditorTool getTool()
    • setTool

      public void setTool(EditorTool tool)
    • isGrid

      public boolean isGrid()
    • setGrid

      public void setGrid(boolean grid)
    • center

      public void center()
    • act

      public void act(float delta)
      Description copied from class: Element
      Updates the actor based on time. Typically this is called each frame by Scene.act(float).

      The default implementation calls Action.act(float) on each action and removes actions that are complete.

      Overrides:
      act in class Element
      Parameters:
      delta - Time in seconds since the last frame.
    • draw

      public void draw()
      Description copied from class: Element
      Draws the element. Does nothing by default.
      Overrides:
      draw in class Element
    • pan

      public boolean pan(float x, float y, float deltaX, float deltaY)
      Description copied from interface: GestureDetector.GestureListener
      Called when the user drags a finger over the screen.
      Specified by:
      pan in interface GestureDetector.GestureListener
      deltaX - the difference in pixels to the last drag event on x.
      deltaY - the difference in pixels to the last drag event on y.
    • zoom

      public boolean zoom(float initialDistance, float distance)
      Description copied from interface: GestureDetector.GestureListener
      Called when the user performs a pinch zoom gesture. The original distance is the distance in pixels when the gesture started.
      Specified by:
      zoom in interface GestureDetector.GestureListener
      Parameters:
      initialDistance - distance between fingers when the gesture started.
      distance - current distance between fingers.
    • pinch

      public boolean pinch(Vec2 initialPointer1, Vec2 initialPointer2, Vec2 pointer1, Vec2 pointer2)
      Description copied from interface: GestureDetector.GestureListener
      Called when a user performs a pinch zoom gesture. Reports the initial positions of the two involved fingers and their current positions.
      Specified by:
      pinch in interface GestureDetector.GestureListener
    • pinchStop

      public void pinchStop()
      Description copied from interface: GestureDetector.GestureListener
      Called when no longer pinching.
      Specified by:
      pinchStop in interface GestureDetector.GestureListener