Scripting/Squirrel/Client Events/GUI::ElementRelease: Difference between revisions

From Vice City Multiplayer
Jump to navigation Jump to search
Caution icon
This wiki is using an old backup from 2020
Some information may be old/missing
(Created page with ". == Syntax == <pre>player - The instance.</pre> == Arguments == * player * GUIButton == Example == Test<- { Hello = null } <source lang=squirrel>function Script::Scrip...")
 
 
Line 12: Line 12:
== Example ==
== Example ==


<source lang=squirrel>
Test<-
Test<-
{
{
Line 17: Line 18:
}
}


<source lang=squirrel>function Script::ScriptLoad()
function Script::ScriptLoad()
{
{
Test.Hello = GUIButton(VectorScreen(400,380), VectorScreen(200, 22), Colour(75,75,75), "Press Here", GUI_FLAG_BORDER | GUI_FLAG_VISIBLE);
Test.Hello = GUIButton(VectorScreen(400,380), VectorScreen(200, 22), Colour(75,75,75), "Press Here", GUI_FLAG_BORDER | GUI_FLAG_VISIBLE);

Latest revision as of 22:35, 1 June 2017

.

Syntax

player - The instance.

Arguments

  • player
  • GUIButton

Example

Test<-
{
Hello = null
}

function Script::ScriptLoad()
{
Test.Hello = GUIButton(VectorScreen(400,380), VectorScreen(200, 22), Colour(75,75,75), "Press Here", GUI_FLAG_BORDER | GUI_FLAG_VISIBLE);
}

function GUI::ElementClick(element, mouseX, mouseY)
{
if (element == Test.Hello)
   {
   Console.Print("Hello. welcome to VCMP")
   }
}

Notes

The event Script::ScriptLoad and function Console::Print were used in in this example. More info about them in the corresponding pages.