Package mindustry.editor
Class MapView
java.lang.Object
arc.scene.Element
mindustry.editor.MapView
- All Implemented Interfaces:
GestureDetector.GestureListener
-
Field Summary
Fields inherited from class arc.scene.Element
color, cullable, fillParent, height, name, originX, originY, parent, parentAlpha, rotation, scaleX, scaleY, touchable, touchablility, translation, userObject, visibility, visible, width, x, y
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
act
(float delta) Updates the actor based on time.void
center()
void
draw()
Draws the element.getTool()
boolean
isGrid()
boolean
pan
(float x, float y, float deltaX, float deltaY) Called when the user drags a finger over the screen.boolean
Called when a user performs a pinch zoom gesture.void
Called when no longer pinching.void
setGrid
(boolean grid) void
setTool
(EditorTool tool) boolean
zoom
(float initialDistance, float distance) Called when the user performs a pinch zoom gesture.Methods inherited from class arc.scene.Element
actions, addAction, addCaptureListener, addListener, change, changed, clear, clearActions, clearListeners, clicked, clicked, clicked, clicked, clipBegin, clipBegin, clipEnd, dragged, exited, fire, fireClick, getActions, getCaptureListeners, getHeight, getListeners, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getPrefHeight, getPrefWidth, getRight, getRotation, getScene, getTop, getWidth, getX, getY, getZIndex, hasActions, hasKeyboard, hasMouse, hasParent, hasScroll, hit, hovered, invalidate, invalidateHierarchy, isAscendantOf, isDescendantOf, isDescendantOf, isTouchable, keepInStage, keyDown, keyDown, layout, localToAscendantCoordinates, localToParentCoordinates, localToStageCoordinates, moveBy, needsLayout, notify, pack, parentToLocalCoordinates, released, remove, removeAction, removeCaptureListener, removeListener, requestKeyboard, requestScroll, rotateBy, rotationChanged, scaleBy, scaleBy, screenToLocalCoordinates, scrolled, setBounds, setColor, setColor, setFillParent, setHeight, setLayoutEnabled, setOrigin, setOrigin, setPosition, setPosition, setRotation, setRotationOrigin, setScale, setScale, setScene, setSize, setSize, setTranslation, setWidth, setZIndex, sizeBy, sizeBy, sizeChanged, stageToLocalCoordinates, tapped, toBack, toFront, toString, touchable, update, updateVisibility, validate, visible
-
Constructor Details
-
MapView
public MapView()
-
-
Method Details
-
getTool
-
setTool
-
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 byScene.act(float)
.The default implementation calls
Action.act(float)
on each action and removes actions that are complete. -
draw
public void draw()Description copied from class:Element
Draws the element. Does nothing by default. -
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 interfaceGestureDetector.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 interfaceGestureDetector.GestureListener
- Parameters:
initialDistance
- distance between fingers when the gesture started.distance
- current distance between fingers.
-
pinch
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 interfaceGestureDetector.GestureListener
-
pinchStop
public void pinchStop()Description copied from interface:GestureDetector.GestureListener
Called when no longer pinching.- Specified by:
pinchStop
in interfaceGestureDetector.GestureListener
-