-
Notifications
You must be signed in to change notification settings - Fork 0
Component
Igor Usenko edited this page May 23, 2022
·
28 revisions
The part of the UI screen.
An array of the components represents the UI screen.
Maintains its state.
Renders its state on the screen
All the components use predefined palette colors only:
-
black
- just black color -
information
- color for information components -
interaction
- color for interactive components -
attention
- color for components which are required user attention
-
bounding box (x, y, w, h)
- x, y initially it is the relative to the parent coordinates. seemount
state
-
mount(component, x, y)
- mounts component to the screen by converting its relative coordinates to the real screen coordinates -
contains(component, x, y)
- returns true if (x, y) is inside component bounding box
-
isStateModified(component)
- compares the new state with previous. returns true if render needed -
updateState(component)
- copies new state data to previous state data -
render(component, forced, tftApi)
- renders the component's state. theforced
flag means that the component should perform a full redraw.
-
onTouch(component, x, y, tickCount)
- called when user touched screen -
onMove(component, x, y, tickCount)
- called when user moving touch point -
onRelease(component, x, y, tickCount)
- called when user released touch screen -
onGesture(component, gesture)
- called when user made a gesture (handled by active tile,by default never reaches to component) -
onButton(component)
- called when user press power button (handled by active tile,by default never reaches to component)