Package mindustry.input
Class DesktopInput
java.lang.Object
mindustry.input.InputHandler
mindustry.input.DesktopInput
- All Implemented Interfaces:
GestureDetector.GestureListener
,InputProcessor
-
Field Summary
Modifier and TypeFieldDescriptionCurrent cursor type.boolean
Whether player is currently deleting removal plans.int
Last known line positions.int
Last known line positions.Whether selecting mode is active.float
Mouse pan speed.boolean
Whether player is currently deleting removal plans.float
Mouse pan speed.float
Mouse pan speed.Previously selected tile.int
Last known line positions.int
Last known line positions.int
Position where the player started dragging a line.int
Position where the player started dragging a line.long
Delta time between consecutive clicks.float
Animation scale for line.int
Position where the player started dragging a line.int
Position where the player started dragging a line.boolean
Whether player is currently deleting removal plans.Selected build plan for movement.Fields inherited from class mindustry.input.InputHandler
block, bplan, buildWasAutoPaused, commandBuildings, commandMode, commandRect, commandRectX, commandRectY, config, controlInterval, controlledType, detector, droppingItem, inputLocks, inv, isBuilding, lastSchematic, line, linePlans, logicCamPan, logicCamSpeed, logicCutscene, logicCutsceneZoom, overrideLineRotation, recentRespawnTimer, resultplan, rotation, selectedUnits, selectPlans, tappedOne, uiGroup, wasShooting
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
buildPlacementUI
(Table table) void
void
void
drawTop()
float
float
boolean
void
Forces the camera to a position and enables panning on desktop.boolean
boolean
Called when a tap occured.boolean
void
update()
protected void
updateMovement
(mindustry.gen.Unit unit) void
void
useSchematic
(Schematic schem) Methods inherited from class mindustry.input.InputHandler
add, addLock, allPlans, breakBlock, buildingControlSelect, canDropItem, canShoot, checkUnit, clearItems, commandBuilding, commandTap, commandUnits, createItemTransfer, deletePlans, drawArrow, drawArrow, drawBreaking, drawBreaking, drawBreakSelection, drawBreakSelection, drawCommand, drawCommanded, drawOverlapCheck, drawOverPlan, drawOverPlan, drawOverSelect, drawPlan, drawPlan, drawPlan, drawRebuildSelection, drawSelected, drawSelection, drawSelection, dropItem, flipPlans, flushPlans, flushPlansReverse, flushSelectPlans, getPlan, getPlan, isDroppingItem, isPlacing, isRebuildSelecting, isUsingSchematic, locked, mouseAngle, multiUnitSelect, onConfigurable, payloadDropped, pickedBuildPayload, pickedUnitPayload, planMatches, rebuildArea, remove, removeQueueBlock, removeSelection, removeSelection, removeSelection, removeSelection, requestBuildPayload, requestDropPayload, requestItem, requestUnitPayload, rotateBlock, rotatePlans, schemOriginX, schemOriginY, selectedCommandUnit, selectedCommandUnits, selectedCommandUnits, selectedControlBuild, selectedEnemyUnit, selectedUnit, selectTypedUnits, selectUnitsRect, setItem, setUnitCommand, showSchematicSave, takeItems, tapCommandUnit, tileConfig, tileTap, transferInventory, transferItemEffect, transferItemTo, transferItemToUnit, tryBreakBlock, tryDropItems, tryDropPayload, tryPickupPayload, unitBuildingControlSelect, unitClear, unitControl, updateLine, updateLine, validBreak, validPlace, validPlace
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface arc.input.GestureDetector.GestureListener
fling, longPress, pan, panStop, pinch, pinchStop, zoom
Methods inherited from interface arc.input.InputProcessor
connected, disconnected, keyDown, keyTyped, keyUp, mouseMoved, scrolled, touchDown, touchDragged, touchUp
-
Field Details
-
movement
-
cursorType
Current cursor type. -
selectX
public int selectXPosition where the player started dragging a line. -
selectY
public int selectYPosition where the player started dragging a line. -
schemX
public int schemXPosition where the player started dragging a line. -
schemY
public int schemYPosition where the player started dragging a line. -
lastLineX
public int lastLineXLast known line positions. -
lastLineY
public int lastLineYLast known line positions. -
schematicX
public int schematicXLast known line positions. -
schematicY
public int schematicYLast known line positions. -
mode
Whether selecting mode is active. -
selectScale
public float selectScaleAnimation scale for line. -
splan
Selected build plan for movement. -
deleting
public boolean deletingWhether player is currently deleting removal plans. -
shouldShoot
public boolean shouldShootWhether player is currently deleting removal plans. -
panning
public boolean panningWhether player is currently deleting removal plans. -
panScale
public float panScaleMouse pan speed. -
panSpeed
public float panSpeedMouse pan speed. -
panBoostSpeed
public float panBoostSpeedMouse pan speed. -
selectMillis
public long selectMillisDelta time between consecutive clicks. -
prevSelected
Previously selected tile.
-
-
Constructor Details
-
DesktopInput
public DesktopInput()
-
-
Method Details
-
buildUI
- Overrides:
buildUI
in classInputHandler
-
drawTop
public void drawTop()- Overrides:
drawTop
in classInputHandler
-
drawBottom
public void drawBottom()- Overrides:
drawBottom
in classInputHandler
-
update
public void update()- Overrides:
update
in classInputHandler
-
useSchematic
- Overrides:
useSchematic
in classInputHandler
-
isBreaking
public boolean isBreaking()- Overrides:
isBreaking
in classInputHandler
-
buildPlacementUI
- Overrides:
buildPlacementUI
in classInputHandler
-
tap
Description copied from interface:GestureDetector.GestureListener
Called when a tap occured. A tap happens if a touch went down on the screen and was lifted again without moving outside of the tap square. The tap square is a rectangular area around the initial touch position as specified on construction time of theGestureDetector
.count
- the number of taps.
-
touchDown
-
selectedBlock
public boolean selectedBlock()- Overrides:
selectedBlock
in classInputHandler
-
getMouseX
public float getMouseX()- Overrides:
getMouseX
in classInputHandler
-
getMouseY
public float getMouseY()- Overrides:
getMouseY
in classInputHandler
-
updateState
public void updateState()- Overrides:
updateState
in classInputHandler
-
panCamera
Description copied from class:InputHandler
Forces the camera to a position and enables panning on desktop.- Overrides:
panCamera
in classInputHandler
-
updateMovement
protected void updateMovement(mindustry.gen.Unit unit)
-