Class element
A generic element every element must inherit from.
Info:
- Copyright: Paul Liverman III (2016)
- License: The MIT License (MIT)
Issues
element.new-todo7 | doc me |
element.new-todo7-todo8 | document this |
Methods
element.new (parent, data) | Constructor expects nothing, or a data table describing it. |
element.setSize (w, h) | Sets an element's width/height. |
element.getSize (self) | Returns an element's width and height. |
element.setWidth (w) | Sets an element's width. |
element.getWidth (self) | Returns an element's width. |
element.setHeight (h) | Sets an element's height. |
element.getHeight (self) | Returns an element's height. |
element.move (self, x, y) | Moves an element by specified x/y. |
element.delete (self) | Deletes references to this element and then deletes it. |
Issues
Methods
- element.new (parent, data)
-
Constructor expects nothing, or a data table describing it.
Parameters:
- parent Element or false The parent element.
- data table [opt] The data (state) for this element.
Returns:
-
element
self
- element.setSize (w, h)
-
Sets an element's width/height. Fixes alignment if needed.
Parameters:
- w integer [opt] Width.
- h integer [opt] Height.
Returns:
-
element
self
- element.getSize (self)
-
Returns an element's width and height.
Parameters:
- self
Returns:
- integer Width.
- integer Height.
- element.setWidth (w)
-
Sets an element's width.
Parameters:
- w integer Width.
Returns:
-
element
self
- element.getWidth (self)
-
Returns an element's width.
Parameters:
- self
Returns:
-
integer
Width.
- element.setHeight (h)
-
Sets an element's height.
Parameters:
- h integer Height.
Returns:
-
element
self
- element.getHeight (self)
-
Returns an element's height.
Parameters:
- self
Returns:
-
integer
Height.
- element.move (self, x, y)
-
Moves an element by specified x/y.
Parameters:
- self
- x
- y
Returns:
-
element
self
- element.delete (self)
-
Deletes references to this element and then deletes it.
Parameters:
- self