Changes between Initial Version and Version 1 of DrawingCommands


Ignore:
Timestamp:
Dec 17, 2011, 5:39:35 PM (12 years ago)
Author:
cinc
Comment:

Explanantion for basic draw commands

Legend:

Unmodified
Added
Removed
Modified
  • DrawingCommands

    v1 v1  
     1= Drawing Commands of the Icon Engine =
     2
     3=== Save/restore current context ===
     4
     5{{{
     6<ctxt>save/restore</>:
     7
     8   Save and restore the current paint context.
     9}}}
     10
     11The 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]]
     12It is save to have several of these commands in a set of commands. Make sure every '''save''' has an associated '''restore'''.
     13
     14See the [IconTutorial Icon Tutorial] for an example.
     15
     16=== Moving the cursor position ===
     17
     18{{{ 
     19<transl>x y</>:
     20
     21   Specify the position for the next paint command.
     22}}}
     23
     24''X'' and ''y'' specify the position on the surface where subsequent painting will take place. 0.0 0.0 is the upper left corner. The values may run from 0.0 to 1.0.
     25
     26See the [IconTutorial Icon Tutorial] for an example.
     27
     28=== Sizing ===
     29
     30{{{ 
     31<scale>xsize ysize</>:
     32
     33   Apply scaling to the next set of commands.
     34}}}
     35
     36The 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.
     37Note that the factors usually have to be rather small. A value of 1.0 does not mean current icon size but is way bigger.
     38
     39See the [IconTutorial Icon Tutorial] for an example.
     40
     41=== Using Images ===
     42
     43{{{
     44<imgkey>imgname # alpha</>:
     45
     46   Paint an image specified by the key 'imgname' on the current surface with an alpha level of 'alpha'.
     47}}}
     48
     49This 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.
     50
     51See the [IconTutorial Icon Tutorial] for an example.
     52