![]() |
findgui() function
Any chance of getting a findgui() function? It returns a reference to the GUI control with the name given.
I'd like to have a class that draws on whichever DrawingPanel control I pass it, but as far as I can tell, there's no way to pass a reference to it or get it from the name. Unless I'm doing something wrong. I've tried PHP Code:
|
GuiControls are objects, so yes
GuiName.drawStuff(); Should work, unless you're doing something wrong in the script itself.. Post some part of your script? |
with ("guiname") {
blah... } or, the same thing Chompy said. The quotations aren't necessary, but needed if you have spaces in the gui name(which you shouldn't), and the gui name is case sensitive, so make sure you do the name exactly as the gui name is when created. |
Echoes nothing (guiref is treated as a string)
PHP Code:
PHP Code:
PHP Code:
|
echo(TextTip.position);
|
You don't understand the original problem.
I want to be able to pass the function which GUI control I want it to draw on; it's dynamic, not static. |
I am not entirely sure I understand what you are trying to do, but in order to pass a GUI object to a function:
PHP Code:
PHP Code:
|
Very messy/inconvenient, but it works, thanks.
|
(@guiname).drawstuff() is the prefered method, but guiname must be correctly written
|
I'm not sure if there is anything that holds priority with variable names over GUIs but if there is (for example say that you had a NPC named ChatBar that held priority over the GUI), such a function might be useful.
|
All times are GMT +2. The time now is 10:39 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.