Squirrel/Client/Functions/GUISprite/GUISprite

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(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…')
 
(Example)
 
Line 18: Line 18:
 
== Example ==
 
== Example ==
  
{{Squirrel/NeedsExample}}
+
<code lang="squirrel">
 +
g_vlogoPos <- VectorScreen( 10, ScreenHeight - 60 );
 +
g_logo <- GUISprite( "logo.png",  ::g_vlogoPos );
  
Explanation here.
+
function onClientSpawn( pClass )
 +
{
  
<code lang="squirrel">
+
g_logo.Visible = true;
-- todo
+
return 1;
 +
}
 
</code>
 
</code>
  

Latest revision as of 01:05, 5 October 2012

Home   |   Squirrel Scripting   |   Server Functions   |   Server Events   |   Client Functions   |   Client Events

This function creates a GUI sprite (an image).

[edit] Syntax

GUISprite can take different lists of parameters. These are:

  1. GUISprite GUISprite( string file )
  1. GUISprite GUISprite( string file, VectorScreen pos )
  1. 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

  1.  
  2. g_vlogoPos <- VectorScreen( 10, ScreenHeight - 60 );
  3. g_logo <- GUISprite( "logo.png",  ::g_vlogoPos );
  4.  
  5. function onClientSpawn( pClass )
  6. {
  7.  
  8. g_logo.Visible = true;
  9. return 1;
  10. }
  11.  

[edit] Notes

Used functions and other notes here.

[edit] Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox