-
Notifications
You must be signed in to change notification settings - Fork 2
Element
Crutiatix edited this page Apr 10, 2017
·
13 revisions
creating:
ticuare.element({})
or ticuare.newElement({})
Attributes:
- x = [number] - x position
- y = [number] - y position
- w = [number] - width
- h = [number] - height
- center = [bool] - if true set default point of positioning into center of element
- colors = [table] - array of 3 colors defined as numbers in range 0-15
- border = [table] - table containing attributes of element's border
- shadow = [table] - table containing attributes of element's shadow
- text = [table] - table containing attributes of element's text
- icon = [table] - table containing attributes of element's icon
- offset = [table] - table containing keys x and y defining offset of element
- drag = [table] - table containing attributes defining draging of element
- content = [table] - table containing attributes defining content of element
- mouse events = [function] - functions called on specific mouse event
Applicable on element:
-
:style() = apply specified style on element
- arguments: style_variable [object]
- return: self [object]
-
:group() = add element to specified group
- arguments: group_variable [object]
- return: self [object]
-
:anchor() = anchor element to another element
- arguments: element_variable [object]
- return: self [object]
-
:setContent()
- arguments: [function]
-
:setContentDimensions()
- arguments: width [number] , height [number]
-
:setScroll()
- arguments: 0-1 [number]
-
:getScroll()
- return: 0-1 [number]
-
:setActive()
- arguments: [bool]
-
:getActive()
- return: [bool]
- :enable()
- :disable()
-
:setVisible()
- arguments: [bool]
-
:getVisible()
- return: [bool]
- :show()
- :hide()
- :drawSelf() = draw only this element
-
:setHorizontalRange() = set normalized number (0-1) of position of element between horizontal bounds
- arguments: 0-1 [number]
-
:getHorizontalRange() = return normalized number (0-1) of position of element between horizontal bounds
- return: 0-1 [number]
-
:setVerticalRange() = set normalized number (0-1) of position of element between horizontal bounds
- arguments: 0-1 [number]
-
:getVerticalRange() = return normalized number (0-1) of position of element between horizontal bounds
- return: 0-1 [number]
-
:setDragBounds() = set boundaries of dragging. Same as attribute drag
- arguments: {x={min,max},y={min,max}} [table]
- return: self [object]
-
:setIndex()
- arguments: [number]
-
:getIndex()
- return: [number]
- :toFront()
- :remove()