Changes between Version 2 and Version 3 of GUI_-_Sprites


Ignore:
Timestamp:
May 25, 2021, 8:26:56 PM (3 years ago)
Author:
Vladislav Belov
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • GUI_-_Sprites

    v2 v3  
    7676Regular RGB colour stamp including transparency eg {{{backcolor="255 0 255 50"}}} (see GUIColor). If no {{{texture}}} property is specified, the area is filled with this colour.
    7777
    78 ==== border ====
    79  * default: "false"
    80  * value: bool string "(true|false)"
    81 
    82 If set to {{{"true"}}}, the texture's area is surrounded by a border in {{{bordercolor}}}, starting at the edge of the image. As the object's {{{buffer_zone}}} increases, the border thickens inwards from the edge.
    83 
    84 If {{{"false"}}}, no border is displayed.
    85 
    86 ==== bordercolor ====
    87  * default: "0 0 0 0"
    88  * value: color
    89 
    90 If {{{border}}} is {{{"true"}}}, this property indicates the RGB colour of the border (see GUIColor).
    91 
    92 Useless if border is not true.
    93 
    94 ==== cell_size ====
    95 
    96 It's often more efficient to put multiple sprites of the same size in a grid, rather than storing each as a separate texture (for example, a series of unit portraits). Although we can reference different areas of a texture and store it in a sprite, each element in a sheet of icons would have to be assigned its own sprite, which would be highly repetitive.
    97 
    98 With this method, we can keep multiple identically-sized icons in one sprite, for example, and reference the individual cells.
    99 
    100 To activate this feature, just add {{{cell_size="<cell_width> <cell_height>"}}} (with appropriate numbers for the width and length of each cell) to the <image> attributes to tell the sprite parser the size of the individual cells:
    101 
    102 {{{
    103   <sprite name="new_name">
    104           <image texture="texture-from-texture-database"
    105                  cell-size="64 64"
    106                  size="0 0 100% 100%"
    107                  texture_size="0 0 100% 100%"
    108           />
    109   </sprite>
    110 }}}
    111 
    112 The GUI control {{{<object>}}}s have a corresponding {{{cell_id}}} attribute to specify which cell of the sprite they should display at the moment; {{{0}}} is the 1st element in the sprite.
    113 
    114 ==== delta_z ====
    115 
    116 Replaced with {{{z_level}}}? Confirm.
    117 
    11878==== real_texture_placement ====
    11979 * default: "0 0 0 0"
     
    163123
    164124Note that {{{"0 0 100% 100%"}}} is the default, so if you need a sprite that simply stretches to fit its control object, you don't need to specify {{{texture_size}}}.
    165 
    166 ==== z_level ====
    167  * default: 0
    168  * value: int
    169 
    170 This is the sprite equivalent of an object's {{{z}}}. Specifying the textures in the right sequence and leaving {{{delta_z}}} alone should normally be sufficient, but if you want to move a texture up or down the layers of the collage, you can specify its {{{delta_z}}} value.
    171125
    172126=== Skip a step ===