Jump to content

How to make and manipulate a gui via the lua scripting interface


TheOfficialStinger

Recommended Posts

haven't been doing anything with the gui's yet, but have you already looked at the /media/lua/ISUI/... files? those are the files that defines the 'classes'.

if you have seen those and know how they work. you should be a little bit closer to the answer

(sorry for the not to the point answer, but I've not enought time at the moment to look into the problem, I will take a better look tomorrow :))

Link to comment
Share on other sites

haven't been doing anything with the gui's yet, but have you already looked at the /media/lua/ISUI/... files? those are the files that defines the 'classes'.

if you have seen those and know how they work. you should be a little bit closer to the answer

(sorry for the not to the point answer, but I've not enought time at the moment to look into the problem, I will take a better look tomorrow :))

 

Ditto. I apologize for not being much help as I am scared to learn lua. I stick to the items and recipes scripting.

Link to comment
Share on other sites

Hello, all!

 I'm just wondering how i would go about creating a simple GUI box in-game that has a text box and a button on it when a player presses a key?

There's some Clydes in it for you if you help! ;D

(clyde)  (clyde)  (clyde)  (clyde)  (clyde)  (clyde)

 

Use this:

 

        -- RoboMat        local modal  = nil;        local posX = 0;        local posY = 0;        local width = 230;        local height = 120;        local text = "This is a modal";        local useYesNo = true;        local toDoWhenClicked = MyFunction.toExecute;        modal = ISModalDialog:new(posX, posY, width, height, text, useYesNo, nil, toDoWhenClicked);        modal:initialise();        modal:addToUIManager();

 

useYesNo determines wether the modal shows just an ok button (then you don't need the onClicked function) or if it shows yes or no.

 

I'm not sure about the key presses though. I'd say you could test if the window is on screen and if a certain key is pressed.

Link to comment
Share on other sites

Thank you all very much!

Here are your clydes:

(clyde)  (clyde)  (clyde)  (clyde)  (clyde)  (clyde)  (clyde)  (clyde)  (clyde) 
If i could trouble your great minds once more...
Now that i have my example panel, how do i go about adding, manipulating, and getting data from a text box when the player presses a button?  More important than that, how do i tell them what happened when they sent the text?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...