User Tools

Site Tools


Differences

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

Link to this comparison view

Next revision
Previous revision
guisys:predefined_methods [2006-09-07 15:05]
Carsten created; much enhanced copy of scripting:windowdef
guisys:predefined_methods [2011-02-20 22:57]
Carsten Deleted page, contents has been migrated to http://api.cafu.de/scripting/classWindowT.html
Line 7: Line 7:
  
  
-====== ====== +===== set(var, value) ​=====
-==== set(var, value) ====+
  
 Sets the window variable with name ''​var''​ to the given value. Sets the window variable with name ''​var''​ to the given value.
Line 26: Line 25:
  
 ^ Name ^ Type ^ Remarks ^ ^ Name ^ Type ^ Remarks ^
-| show | bool  | If this window is shown. | +| show     ​boolean ​ | If this window is shown. | 
-| time | float | Automatically incremented on each frame, but can freely be modified. | +| time     ​number ​  | Automatically incremented on each frame, but can freely be modified. | 
-| rotAngle | float | The angle of rotation of this window, in degrees (0..360). |+| rotAngle | number ​  | The angle of rotation of this window, in degrees (0..360). |
 | ||| | |||
 ^ Name ^ Type ^ Remarks ^ ^ Name ^ Type ^ Remarks ^
-| rect | floatfloatfloatfloat | The (x, y) position and (width, height) dimensions of this window. The position is relative to the parent window. | +| rect | numbernumbernumbernumber ​| The (x, y) position and (width, height) dimensions of this window. The position is relative to the parent window. | 
-| pos  | floatfloat               | Just the first two components of ''​rect'':​ the (x, y) position, relative to the parent window. | +| pos  | numbernumber ​              | Just the first two components of ''​rect'':​ the (x, y) position, relative to the parent window. | 
-| size | floatfloat               | Just the last two components of ''​rect'':​ The width and height. | +| size | numbernumber ​              | Just the last two components of ''​rect'':​ The width and height. | 
-| pos.x | float | The x-position of this window (1st component of ''​rect''​). | +| pos.x | number ​| The x-position of this window (1st component of ''​rect''​). | 
-| pos.y | float | The y-position of this window (2nd component of ''​rect''​). | +| pos.y | number ​| The y-position of this window (2nd component of ''​rect''​). | 
-| size.x | float | The width of this window (3rd component of ''​rect''​). | +| size.x | number ​| The width of this window (3rd component of ''​rect''​). | 
-| size.y | float | The height of this window (4th component of ''​rect''​). |+| size.y | number ​| The height of this window (4th component of ''​rect''​). |
 | ||| | |||
 ^ Name ^ Type ^ Remarks ^ ^ Name ^ Type ^ Remarks ^
-| backMaterial | string ​                    ​| The name of the MatSys material to be used as the background image of this window. | +| backMaterial | string ​                        ​| The name of the MatSys material to be used as the background image of this window. | 
-| backColor ​  ​floatfloatfloatfloat | The red, green, blue and alpha components of the background color. | +| backColor ​   numbernumbernumbernumber ​| The red, green, blue and alpha components of the background color. | 
-| backColor.r | float                      ​| The red component of the background color. | +| backColor.r ​ number ​                        | The red component of the background color. | 
-| backColor.g | float                      ​| The green component of the background color. | +| backColor.g ​ number ​                        | The green component of the background color. | 
-| backColor.b | float                      ​| The blue component of the background color. | +| backColor.b ​ number ​                        | The blue component of the background color. | 
-| backColor.a | float                      ​| The alpha component of the background color. |+| backColor.a ​ number ​                        | The alpha component of the background color. |
 | ||| | |||
 ^ Name ^ Type ^ Remarks ^ ^ Name ^ Type ^ Remarks ^
-| borderWidth ​  ​| ​float                      ​| The width of the border frame. | +| borderWidth ​  ​| ​number ​                        | The width of the border frame. | 
-| borderColor ​  ​| ​floatfloatfloatfloat | The red, green, blue and alpha components of the border color. | +| borderColor ​  ​| ​numbernumbernumbernumber ​| The red, green, blue and alpha components of the border color. | 
-| borderColor.r | float                      ​| The red component of the border color. | +| borderColor.r | number ​                        | The red component of the border color. | 
-| borderColor.g | float                      ​| The green component of the border color. | +| borderColor.g | number ​                        | The green component of the border color. | 
-| borderColor.b | float                      ​| The blue component of the border color. | +| borderColor.b | number ​                        | The blue component of the border color. | 
-| borderColor.a | float                      ​| The alpha component of the border color. |+| borderColor.a | number ​                        | The alpha component of the border color. |
 | ||| | |||
 ^ Name ^ Type ^ Remarks ^ ^ Name ^ Type ^ Remarks ^
-| font         | string ​                    ​| The name of the font to render the text with. | +| font         | string ​                        ​| The name of the font to render the text with. | 
-| text         | string ​                    ​| The text to display in this window. | +| text         | string ​                        ​| The text to display in this window. | 
-| textColor ​   | floatfloatfloatfloat | The red, green, blue and alpha components of the text color. | +| textColor ​   | numbernumbernumbernumber ​| The red, green, blue and alpha components of the text color. | 
-| textColor.r ​ | float                      ​| The red component of the text color. | +| textColor.r ​ | number ​                        | The red component of the text color. | 
-| textColor.g ​ | float                      ​| The green component of the text color. | +| textColor.g ​ | number ​                        | The green component of the text color. | 
-| textColor.b ​ | float                      ​| The blue component of the text color. | +| textColor.b ​ | number ​                        | The blue component of the text color. | 
-| textColor.a ​ | float                      ​| The alpha component of the text color. | +| textColor.a ​ | number ​                        | The alpha component of the text color. | 
-| textScale ​   | float                      ​| The relative size of the text. 1 = 48pt, 0.5 = 24pt, etc. | +| textScale ​   | number ​                        | The relative size of the text. 1 = 48pt, 0.5 = 24pt, etc. | 
-| textAlignHor | int                        ​| The horizontal text alignment mode: 0 = left (default), 1 = right, 2 = center. | +| textAlignHor | number (integer) ​              | The horizontal text alignment mode: 0 = left (default), 1 = right, 2 = center. | 
-| textAlignVer | int                        ​| The vertical text alignment mode: 0 = top (default), 1 = bottom, 2 = middle. |+| textAlignVer | number (integer) ​              | The vertical text alignment mode: 0 = top (default), 1 = bottom, 2 = middle. |
  
   * Also note that all coordinates are given with regards to the "​virtual screen coordinate system",​ which has a resolution of 640 * 480 pixels and is automatically scaled to the true resolution.   * Also note that all coordinates are given with regards to the "​virtual screen coordinate system",​ which has a resolution of 640 * 480 pixels and is automatically scaled to the true resolution.
Line 82: Line 81:
  
  
-====== ====== +===== get(var) ​=====
-==== get(var) ====+
  
-Returns the value the window variable.+Returns the value of the specified ​window variable.
  
 === Parameters: === === Parameters: ===
Line 94: Line 92:
 The value of the desired variable in the appropriate type. The value of the desired variable in the appropriate type.
  
-As Lua supports //tuples// as return types, this method works with all variables listed at the [[#set_name_value|set()]] method, except for "​backMaterial"​ and "​font",​ which are write-only.+As Lua supports //tuples// as return types, this method works with all variables listed at the [[guisys:​predefined_methods#set_var_value|set()]] method, except for "​backMaterial"​ and "​font",​ which are write-only.
  
  
Line 116: Line 114:
  
  
-====== ====== +===== interpolate(var,​ s, e, t) =====
-==== interpolate(var,​ s, e, t) ====+
  
 Interpolates the value of the given variable from start value ''​s''​ to end value ''​e''​ over time ''​t''​. Interpolates the value of the given variable from start value ''​s''​ to end value ''​e''​ over time ''​t''​.
Line 132: Line 129:
  
 === Notes: === === Notes: ===
-  * For ''​var''​ only variables of type __float__ ​are allowed, see [[#set_name_value|set()]] for a list.+  * For ''​var'' ​//only variables of type **number** ​are allowed//, see [[guisys:​predefined_methods#set_var_value|set()]] for a list.
  
 === Example: === === Example: ===
Line 144: Line 141:
  
  
-====== ====== +===== __tostring() ​=====
-==== __tostring() ====+
  
 Returns a short string that describes the window. Returns a short string that describes the window.