Scripting/Squirrel/Client Events/GUI::ElementClick: Difference between revisions
Jump to navigation
Jump to search
This wiki is using an old backup from 2020
Some information may be old/missing
Kennedyarz (talk | contribs) (Created page with ". == Syntax == <pre>player - The instance.</pre> == Arguments == * player * GUIButton == Example == Press Button <code lang="squirrel"> function Script::ScriptLoad() {...") |
Kennedyarz (talk | contribs) No edit summary |
||
Line 11: | Line 11: | ||
== Example == | == Example == | ||
<code lang="squirrel"> | <code lang="squirrel"> | ||
function Script::ScriptLoad() | function Script::ScriptLoad() | ||
{ | { | ||
Line 26: | Line 24: | ||
Console.Print("Hello. welcome to VCMP") | Console.Print("Hello. welcome to VCMP") | ||
} | } | ||
} | |||
</code> | </code> | ||
Revision as of 19:31, 14 March 2017
.
Syntax
player - The instance.
Arguments
- player
- GUIButton
Example
function Script::ScriptLoad()
{
- 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 == 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.