UI script from 2.4 to 2.5
Revision as of 17:09, 4 May 2012 by Bayo (talk | contribs) (→Extension of sprites to merge code: explain better)
Component syntax
- Component syntax was unclear. Now it use the same syntax as
window
withextends
keywork. Be carefull the order of the terme change.component my-component extends another-component
instead ofcomponent another-component my-component
Extension of sprites to merge code
Sprite support now tiled image we use for button and window. For a first small step, the file base/ufos/sprites_tiled.ufo
contains all descriptions of tiled sprites [1]. But idea is to move later this properties next to image, and syntax will change.
On a side note, we can now use tiled or untiled sprites for most of the nodes, and we can easilly add more tile templates if it is need (bigger/smaller borders...)
image
is deprecated for most of nodeswindow
/button
/panel
/optionlist/checkbox
/optiontree
... Others will come later. We must usebackground
property which is a sprite.base/ufos/sprites_tiled.ufo
curently override old image name with new sprite name. Then for nodes which support background, it should only need to rename theimage
propery tobackground
property. [2]
custombutton
is then useless and deprecated.- A simple rename to
button
should work. [3]
- A simple rename to
- tiled images should be moved into
base/pics/tiled
- Cause we use sprites, image for checkbox is not at the same location, and it do not use anymore
image
, but sprites.- Two components have been created:
checkbox_blue
andcheckbox_green
. You can check the code on the file_menu.ufo
. - images are located inside
pics/banks/checkbox_*
, and next everything will be splited intopics/icons/checkbox_*
- while images are not splited, script
ufos/sprites_tmp.ufo
contains name of the sprites used to the checkboxs (which will became later name of image insidepics/icons
).
- Two components have been created:
Event callback
- click event are detected on the mouse up, and not the mouse down
- a click event can be disabled with another button down. Left button down, then right button down, then left button up, then right button up will not produce any click event.
onScroll
/onScrollUp
/onScrollDown
is now fired to parent nodes if the node do not catch it. An empty event will stop the propagation (onScroll {}
)- click events will follow the same way
panel
node is scrollable by default with mouse wheel/long left click/drag move.