hey guyyz how to have a sprite as a button?
test <- null;
function Script::ScriptLoad()
{
:: test = GUISprite("tesst.png", VectorScreen(x, y));
::GUI.SetMouseEnabled(true);
}
You need to add the flag GUI_MOUSE_CTRL and then use it as a normal button.
sir any code for reffernece
test <- null;
function Script::ScriptLoad()
{
GUI.SetMouseEnabled(true);
:: test = GUISprite("tesst.png", VectorScreen(0, 0));
:: test.Size = VectorScreen(35, 100);
:: test.AddFlags(GUI_FLAG_MOUSECTRL);
}
test <- null;
function Script::ScriptLoad()
{
::test = GUISprite("tesst.png", VectorScreen(x, y));
::test.AddFlags(GUI_MOUSE_CTRL);
::GUI.SetMouseEnabled(true);
}
function onElementClick(balblablablalbala)
{
if( element == ::test ) JUST_DO_IT();
}
test <- null;
function Script::ScriptLoad()
{
::test = GUISprite("tesst.png", VectorScreen(0, 0));
::GUI.SetMouseEnabled(true);
::test.AddFlags(GUI_MOUSE_CTRL);
}
function onElementClick(element, mouseX, mouseY)
{
if (element == ::test)
{
local D = Stream();
D.WriteString("Delettest");
Server.SendData(D);
}
::GUI.SetMouseEnabled(false);
}
function Server::ServerData(stream)
{
local ReadStri = stream.ReadString();
if(ReadStri=="DelettestSide")
{
::test<-null;//Delete
}
}
not working i want to click the image and then the image and mouse should get closed