Changes between Initial Version and Version 1 of GUI_-_Repeat


Ignore:
Timestamp:
Feb 3, 2014, 2:29:18 PM (10 years ago)
Author:
Josh
Comment:

Add page on the GUI repeat object

Legend:

Unmodified
Added
Removed
Modified
  • GUI_-_Repeat

    v1 v1  
     1= Repeat =
     2The repeat object is designed to simplify cases where you have a large number of very similar objects nearby each other.
     3== Explanation ==
     4The repeat object generates "count" copies of any objects nested within it. Since you can not have multiple copies of the same named object you insert "[n]" somewhere in the name. After parsing, the "n" is replaced with the index of the generated object in the repeat.
     5
     6'''Important:''' The repeat element does not automatically adjust child element sizing.
     7== Example ==
     8For example, the following XML could be simplified by using a repeat element.
     9{{{
     10#!xml
     11<object name="myObj[0]" type="sprite" sprite="mySprite"/>
     12<object name="myObj[1]" type="sprite" sprite="mySprite"/>
     13<object name="myObj[2]" type="sprite" sprite="mySprite"/>
     14}}}
     15The next snippet uses the repeat element to create the same result.
     16{{{
     17#!xml
     18<repeat count="3">
     19    <object name="myObj[n]" type="sprite" sprite="mySprite"/>
     20</repeat>
     21}}}