Jump to content




GUI.API | Simple & Powerful Buttons,Dialogue Boxes, Text-boxes, and More!

api lua computer

  • You cannot reply to this topic
49 replies to this topic

#41 Corky_McDuff

  • Members
  • 31 posts

Posted 04 October 2014 - 08:25 AM

Hmm, I love this but I am way out of my depth here.
Would anyone be kind enough to assist I incorporating buttons into my teleport program please?
I would like a list of deck descriptions and a corresponding numbers next to it that once click teleports to that location.
This will be used for my Starship Enterprise Turbo Lifts and there are several decks in place, so will need small buttons to fit them all in.
My program is gbB2eRG1 if you are interested.
Thanks in advance...sorry for being so useless at this!

#42 Dragon53535

  • Members
  • 973 posts
  • LocationIn the Matrix

Posted 04 October 2014 - 09:00 AM

View PostCorky_McDuff, on 04 October 2014 - 08:25 AM, said:

Hmm, I love this but I am way out of my depth here.
Would anyone be kind enough to assist I incorporating buttons into my teleport program please?
I would like a list of deck descriptions and a corresponding numbers next to it that once click teleports to that location.
This will be used for my Starship Enterprise Turbo Lifts and there are several decks in place, so will need small buttons to fit them all in.
My program is gbB2eRG1 if you are interested.
Thanks in advance...sorry for being so useless at this!
You could ask in the Ask a Pro section, alot of us lurk in there awaiting fun topics :P Also you will probably get more views that way and thus more help.

#43 TheCaptainSly

  • Members
  • 10 posts
  • LocationWoodriver, Illinois

Posted 11 October 2014 - 12:12 AM

My question is going to be pretty hard for me to state but I'll give it a shot.

With the dialogue boxes I understand that Y = true and N = false. But I want to be able to use that in an if statement and decide whether or not Yes or No was clicked. I've tried everything I could think of. I'll put the most recent attempt in the spoiler below. If anything in the buttons and such look weird, It's probably because I typed it wrong. Everything in the actual program is typed correctly.

Spoiler

I want to know what variable says true when I click yes and what variable says false when I click no. This code should work as it is copied from my original code that has been heavily tested.

I fixed the code and everything so it should now convey what I'm trying to ask.

Edited by TheCaptainSly, 13 October 2014 - 05:16 PM.


#44 newcat

  • Members
  • 43 posts
  • LocationStuttgart, Germany

Posted 11 October 2014 - 09:44 PM

View PostTheCaptainSly, on 11 October 2014 - 12:12 AM, said:

--snip--

You wrote "y/n" as box type, but it actually needs to be "yn".
I didn't test it but the code you posted should not display anything and the return value will be nil.

Edited by newcat, 11 October 2014 - 09:45 PM.


#45 TheCaptainSly

  • Members
  • 10 posts
  • LocationWoodriver, Illinois

Posted 13 October 2014 - 05:18 PM

View Postnewcat, on 11 October 2014 - 09:44 PM, said:

View PostTheCaptainSly, on 11 October 2014 - 12:12 AM, said:

--snip--

You wrote "y/n" as box type, but it actually needs to be "yn".
I didn't test it but the code you posted should not display anything and the return value will be nil.

I've fixed the code. If you could check the original post that would be super. Sorry for not checking and testing said code before asking. I know it's hard to give help if you can't understand what the asker is asking.

#46 newcat

  • Members
  • 43 posts
  • LocationStuttgart, Germany

Posted 13 October 2014 - 08:39 PM

Oh ok now I got what you were asking for.
The draw-method is the thing that returns true or false so basically what you need to do is to place a variable in front of the method like this:

result = skipfileCheck:draw( 20, 5, 7, colors.gray, colors.lightBlue, colors.white )

Now the result variable holds either true or false, depending what the user clicked on.

Hope it helped you and sorry for the poor formatting, I am writing on my mobile phone.

#47 TheCaptainSly

  • Members
  • 10 posts
  • LocationWoodriver, Illinois

Posted 13 October 2014 - 10:13 PM

Ok I get now... I think If I have another question I'll surely tell you! Thank you

#48 Kizz

  • Members
  • 99 posts
  • LocationLouisville, Kentucky

Posted 23 April 2015 - 01:36 PM

This api is extremely unstable :(. I had to make major changes just to be able to add multiple buttons. Even still, the toggle and remove functions do not work at all. I had to rebuild the detect API to pull an event so that you can click a button. The button table almost always crashed on a nil value for some reason.

It looked promising but is clearly unfinished and no longer active. :(

#49 chrdov

  • Members
  • 86 posts
  • Locationchrdov's Domain, Cyberspace

Posted 22 May 2015 - 08:51 PM

do the creation functions and detection function actually return anything, like the element that was clicked?

#50 newcat

  • Members
  • 43 posts
  • LocationStuttgart, Germany

Posted 23 May 2015 - 01:05 AM

The creation function returns the button object (this API is object-oriented) and the detect function returns the label of the clicked button.

I made a tutorial a while ago so if you want to know more about this API just scroll up some posts and check out the video. I also show a little snippet in the tutorial which expands the detect function a bit.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users