User Tools

Site Tools


en:template:styles

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
Next revision Both sides next revision
en:template:styles [2016/08/10 16:53]
Nicolas Ronvel created
en:template:styles [2016/08/16 13:25]
Nicolas Ronvel [Editable Fields]
Line 69: Line 69:
   * [[Numeric Input Field]]   * [[Numeric Input Field]]
   * [[Color Picker]]   * [[Color Picker]]
 +
 +=== Order of the Editable fields ===
 +
 +The editable fields are //​displayed//​ one after the other, the first item of the array being the one first displayed. You can change this by setting an ''​order''​ property on a field, and defining the order of the element (an integer). The editable fields are sorted in ascending order. ​
 +
 +Note that the ''​order''​ property is set by default to a value of ''​1''​.
  
 ==== The Card / Canvas ==== ==== The Card / Canvas ====
Line 82: Line 88:
   * [[Code Variables]]   * [[Code Variables]]
  
 +=== Order of the Canvas elements ===
 +
 +The elements of the canvas are //drawn// one after the other, the first item of the array being the one first drawn. You can change this by setting an ''​order''​ property on a field, and defining the order of the element (an integer). The elements of the canvas are sorted in ascending order. ​
 +
 +Note that the ''​order''​ property is set by default to a value of ''​1''​.
 ===== Inheriting styles ===== ===== Inheriting styles =====
  
Line 155: Line 166:
  
 <code javascript>​ <code javascript>​
-    ​"​fields":​ [ +"​fields":​ [ 
-        { "​name":​ "​field01",​ "​label":​ "Name :", "​default":​ "​Default name", "​isNameField":​ true }, +    { "​name":​ "​field01",​ "​label":​ "Name :", "​default":​ "​Default name", "​isNameField":​ true }, 
-        { "​name":​ "​field02",​ "​label":​ "Class :", "​default":​ "​Default class",​ "​isNameField":​ false } +    { "​name":​ "​field02",​ "​label":​ "Class :", "​default":​ "​Default class",​ "​isNameField":​ false } 
-    ]+]
 </​code>​ </​code>​
  
Line 164: Line 175:
  
 <code javascript>​ <code javascript>​
-    ​"​fields":​ [ +"​fields":​ [ 
-        { "​name":​ "​field02",​ "​label":​ "​Current Class :" } +    { "​name":​ "​field02",​ "​label":​ "​Current Class :" } 
-        { "​name":​ "​field03",​ "​label":​ "Level :", "​default":​ "​Default level" } +    { "​name":​ "​field03",​ "​label":​ "Level :", "​default":​ "​Default level" } 
-    ]+]
 </​code>​ </​code>​
  
Line 193: Line 204:
     { "​id":​ "​class",​ "​type":​ "​textbox",​ "​text":​ "​$class",​ "​left":​ 91, "​top":​ 60, "​width":​ 351, "​textAlign":​ "​center",​ "​fill":​ "#​FFD800",​ "​fontFamily":​ "​Arial",​ "​fontWeight":​ 700, "​fontSize":​ 38 }     { "​id":​ "​class",​ "​type":​ "​textbox",​ "​text":​ "​$class",​ "​left":​ 91, "​top":​ 60, "​width":​ 351, "​textAlign":​ "​center",​ "​fill":​ "#​FFD800",​ "​fontFamily":​ "​Arial",​ "​fontWeight":​ 700, "​fontSize":​ 38 }
 ] ]
 +</​code>​
  
 Child'​s fields :  Child'​s fields : 
  
 +<code javascript>​
 "​fields":​ [ "​fields":​ [
     { "​id":​ "​class",​ "​text":​ "​$class$ - Lvl.$level$"​ },     { "​id":​ "​class",​ "​text":​ "​$class$ - Lvl.$level$"​ },
     { "​type":​ "​textbox",​ "​text":​ "​Current class",​ "​left":​ 91, "​top":​ 90, "​width":​ 351, "​textAlign":​ "​center",​ "​fill":​ "#​FFD800",​ "​fontFamily":​ "​Arial",​ "​fontSize":​ 14 }     { "​type":​ "​textbox",​ "​text":​ "​Current class",​ "​left":​ 91, "​top":​ 90, "​width":​ 351, "​textAlign":​ "​center",​ "​fill":​ "#​FFD800",​ "​fontFamily":​ "​Arial",​ "​fontSize":​ 14 }
 ] ]
 +</​code>​
  
 Any property of a canvasField can be modified in a child canvasField : ''​text'',​ ''​left'',​ ''​top'',​ ''​fontFamily'',​ ... Feel free to have a look at existing templates to discover how inheritance works. Any property of a canvasField can be modified in a child canvasField : ''​text'',​ ''​left'',​ ''​top'',​ ''​fontFamily'',​ ... Feel free to have a look at existing templates to discover how inheritance works.
 +
 +==== Ignoring a Parent field ====
 +
 +Following the completion of [[http://​www.github.com/​gulix/​geckos/​issues/​102|Issue #102]], you can use the property ''​ignored''​ in a field (//​editable//​ or //canvas// field) and set it to ''​true''​ in order to ignore it in the generated style (it will not be inserted in the arrays).
 +
 +This property follows all the rules of inheritance. If a parent style set it to ''​true'',​ a child could still reset it to ''​false''​.
 +
en/template/styles.txt · Last modified: 2017/07/18 16:10 by Nicolas Ronvel