Squirrel/Client/Functions/GUISprite/GUISprite
From Liberty Unleashed Wiki
(Difference between revisions)
(Created page with '{{Squirrel/Title|GUISprite}} This function creates a GUI sprite (an image). == Syntax == ''GUISprite'' can take different lists of parameters. These are: <code>GUISprite GUISp…') |
IdkanYavuk (Talk | contribs) (→Example) |
||
Line 18: | Line 18: | ||
== Example == | == Example == | ||
− | + | <code lang="squirrel"> | |
+ | g_vlogoPos <- VectorScreen( 10, ScreenHeight - 60 ); | ||
+ | g_logo <- GUISprite( "logo.png", ::g_vlogoPos ); | ||
− | + | function onClientSpawn( pClass ) | |
+ | { | ||
− | + | g_logo.Visible = true; | |
− | + | return 1; | |
+ | } | ||
</code> | </code> | ||
Latest revision as of 01:05, 5 October 2012
This function creates a GUI sprite (an image).
[edit] Syntax
GUISprite can take different lists of parameters. These are:
GUISprite GUISprite( string file )
GUISprite GUISprite( string file, VectorScreen pos )
GUISprite GUISprite( string file, VectorScreen pos, float rotation, VectorScreen rotationcentre )
[edit] Arguments
- file - The filename of the sprite to be drawn
- pos - The position of the sprite on screen or related to its parent. This parameter is optional
- rotation - The sprite rotation in degrees. This parameter is optional
- rotationcentre - The rotation centre relative to the sprite coordinates. This parameter is optional
[edit] Example
g_vlogoPos <- VectorScreen( 10, ScreenHeight - 60 ); g_logo <- GUISprite( "logo.png", ::g_vlogoPos ); function onClientSpawn( pClass ) { g_logo.Visible = true; return 1; }
[edit] Notes
Used functions and other notes here.