Changes between Version 8 and Version 9 of IconTutorial


Ignore:
Timestamp:
Dec 29, 2007, 8:54:46 AM (16 years ago)
Author:
cinc
Comment:

Explanantion of <imgkey> command

Legend:

Unmodified
Added
Removed
Modified
  • IconTutorial

    v8 v9  
    142142=== The commands in detail ===
    143143
    144  <ctxt>save/restore<\>::
     144{{{
     145<ctxt>save/restore</>:
     146
    145147   Save and restore the current paint context.
     148}}}
    146149
    147 The icon engine holds internal data defining the current colors, fonts, angle of rotation etc. Some paint commands alter this information in a global way. To preserve a set state the ''<ctxt>'' command can be used. It stores all the data on a stack and any changes will be reverted when issuing a ''<ctx>restore<\>''.[[BR]]
     150The icon engine holds internal data defining the current colors, fonts, angle of rotation etc. Some paint commands alter this information in a global way. To preserve a set state the ''<ctxt>'' command can be used. It stores all the data on a stack and any changes will be reverted when issuing a ''<ctx>restore</>''.[[BR]]
    148151It is save to have several of these commands in a set of commands. Make sure every '''save''' has an associated '''restore'''.
    149  
     152
     153----
     154
     155{{{ 
     156<scale>xsize ysize</>:
     157
     158   Apply scaling to the next set of commands.
     159}}}
     160
     161The values ''xsize'' and ''ysize'' are factors between 0.0 and 1.0. They specify the size of the items which will be painted afterwards. Note that this scaling is a global setting and will be applied to all paint commands which follow. Use ''<ctxt>save</>'' to save current scaling settings.
     162Note that the factors usually have to be rather small. A value of 1.0 does not mean current icon size but is way bigger.
     163
     164----
     165
     166{{{
     167<imgkey>imgname # alpha</>:
     168
     169   Paint an image specified by the key ''imgname'' on the current surface with an alpha level of ''alpha''.
     170}}}
     171
     172This command will paint an image at the current position with the current scaling. The value of ''alpha'' may run from 0.0 to 1.0 where 1.0 means completely opaque while 0.0 means completely translucent. ''imgname'' is the name of a key in the ini file specifiying the image file to be used. The path is a relative one as known from the 'Image' key. Note that the spelling of the key is important and references to keys belonging to other icons are not possible.
     173