Class Brush
java.lang.Object
group24.escaperoom.ui.editorTools.EditorTool
group24.escaperoom.ui.editorTools.Brush
- Direct Known Subclasses:
ItemBrush
Base class for Brushes
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcancel()Called when the user presses Escape while this is the active tooldraw(int x, int y) abstract ItemgetItem()getType()abstract voidhandleDrag(float x, float y) abstract booleanhandleTouchDown(float x, float y) abstract voidHandle a touchup eventabstract booleanvoidselect()Called when this tool is selectedMethods inherited from class group24.escaperoom.ui.editorTools.EditorTool
getButtonStyle, getEditor, getName
-
Constructor Details
-
Brush
- Parameters:
editor- on which this brush will operate
-
-
Method Details
-
select
public void select()Description copied from class:EditorToolCalled when this tool is selected- Specified by:
selectin classEditorTool
-
cancel
public void cancel()Description copied from class:EditorToolCalled when the user presses Escape while this is the active tool- Specified by:
cancelin classEditorTool
-
draw
- Parameters:
x- coord in game units where this brush should drawy- coord in game units where this brush should draw- Returns:
- the newly drawn item
-
handleTouchDown
public abstract boolean handleTouchDown(float x, float y) - Parameters:
x- touchdown coordy- touchdown coord- Returns:
- whether the brush is handling this event
-
handleTouchUp
public abstract void handleTouchUp()Handle a touchup event -
handleDrag
public abstract void handleDrag(float x, float y) - Parameters:
x- drag coordy- drag coord
-
getItem
- Returns:
- item that is drawn with this brush
-
isDrawing
public abstract boolean isDrawing()- Returns:
- whether this brush is currently drawing
-
getType
- Specified by:
getTypein classEditorTool- Returns:
- the
ToolManager.ToolType
-