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
windowwithextendskeywork. Be carefull the order of the terme change.component my-component extends another-componentinstead 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...)
imageis deprecated for most of nodeswindow/button/panel/optionlist/checkbox/optiontree... Others will come later. We must usebackgroundproperty which is a sprite.base/ufos/sprites_tiled.ufocurently override old image name with new sprite name. Then for nodes which support background, it should only need to rename theimagepropery tobackgroundproperty. [2]
custombuttonis then useless and deprecated.- A simple rename to
buttonshould 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_blueandcheckbox_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.ufocontains 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/onScrollDownis 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
panelnode is scrollable by default with mouse wheel/long left click/drag move.