-
class Tool:
Object¶ -
__new(self:
Object, ...:any)¶ The default constructor for the class. Subclasses should override this.
-
update(self:
Tool, dt:number, editor:Editor)¶ Updates the tool state.
- Parameters:
dt (
number) – The time delta since the last update.editor (
Editor) – The editor instance.
-
getDrawable(
self:Tool,
placeable: {entity:Entity, factory: fun():Entity}
):Drawable¶ Returns the Drawable from placeable
-
drawCell(
self:Tool,
display:Display,
drawable:Drawable,
x:integer,
y:integer
)¶ Draws a cell at the given coordinates.
-
mouseclicked(
self:Tool,
editor:Editor,
level:any,
cellx:number,
celly:number
)¶ Handles mouse click events.
- Parameters:
cellx (
number) – The x-coordinate of the cell clicked.celly (
number) – The y-coordinate of the cell clicked.
-
mousereleased(
self:Tool,
editor:Editor,
level:any,
cellx:number,
celly:number
)¶ Handles mouse release events.
- Parameters:
cellx (
number) – The x-coordinate of the cell release.celly (
number) – The y-coordinate of the cell release.
Other members:
Inherited from
Object:_serializationBlacklist,adopt(),assertType(),className,deepcopy(),deserialize(),extend(),instanceOf(),is(),isInstance(),mixin(),prettyprint(),serializationBlacklist,serialize()-
__new(self: