Package de.tum.cit.ase.editor.tools
Class Pen
java.lang.Object
de.tum.cit.ase.editor.input.ToolInputAdapter
de.tum.cit.ase.editor.tools.EditorTool
de.tum.cit.ase.editor.tools.Pen
- All Implemented Interfaces:
com.badlogic.gdx.InputProcessor,com.badlogic.gdx.utils.Pool.Poolable,ShortcutAdapter,Tool
The Pen class represents a pen tool used for drawing on a canvas. It extends the EditorTool class.
-
Field Summary
Fields inherited from class de.tum.cit.ase.editor.tools.EditorTool
bresenham2, canvas, lastGridPosition, lastPositionFields inherited from interface de.tum.cit.ase.editor.input.ShortcutAdapter
pressedKeys -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class de.tum.cit.ase.editor.tools.EditorTool
draw, getGrid, getInstance, getLine, getStraightLineCoordinates, isStraightLine, projectGridPointToWorld, projectGridPointToWorld, touchDown, touchDragged, touchUpMethods inherited from class de.tum.cit.ase.editor.input.ToolInputAdapter
keyDown, keyTyped, keyUp, mouseMoved, scrolled, touchCancelledMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.tum.cit.ase.editor.input.ShortcutAdapter
addKey, isShortcut, isShortcut, isShortcut, removeKey
-
Constructor Details
-
Pen
public Pen()
-
-
Method Details
-
validate
public void validate()Description copied from interface:ToolValidates the current state of the tool. This method is called internally to ensure the tool is in a valid state. It performs necessary validations and updates to the tool's internal state.- Specified by:
validatein interfaceTool- Overrides:
validatein classEditorTool
-
markTile
Description copied from class:EditorToolMarks a tile on the grid based on the given grid point.- Specified by:
markTilein classEditorTool- Parameters:
gridPoint- the grid point representing the tile to be marked- Throws:
InvalidGridCellException- if the grid point is invalid
-
reset
public void reset()Description copied from class:EditorToolResets the state of the tool.This method is responsible for resetting the tool to its initial state by setting the
canvasfield tonull, and clearing thelastPositionandlastGridPositionfields.- Specified by:
resetin interfacecom.badlogic.gdx.utils.Pool.Poolable- Overrides:
resetin classEditorTool
-