Jump to content




[API] Menu / GUI maker - Scrolling, mouse support, customisation


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

#1 kylergs

  • Members
  • 61 posts
  • LocationUK

Posted 05 December 2012 - 11:45 AM

As an extension from my past program I decided to create an API to allow you to create fully navigable menu's and interfaces.

Almost everything is customisable, but it can become a bit complicated if you want to do things seamlessly.
There is same automatic function built in but for more interactive menus you should set it up yourself.

Here are the functions:
Spoiler

Now here are the overlay functions
Spoiler

Item commands
Spoiler

Menu Commands
Spoiler

Automatic use:

There is a little bit of automation available here.
Initially, you do not need an Overlay, a small, default one is created automatically
Secondly, in a few cases, you can use item types to navigate menus better
e.g.
if the type is "text" (default) - Nothing will happen on click/ enter
if the type is "menu" and a menu (the object itself) is saved to the data, it will automatically link there.
if the type is "msgbox" and there is a table in the data, a msg box will be drawn


Finally, an image
Spoiler


And the message box
Spoiler

And the code:
http://pastebin.com/PmCUHuTr

and the code I used for that menu shown:

http://pastebin.com/s8PkZRjs


Enjoy and please respond with any suggestions / bugs / comments!

#2 kylergs

  • Members
  • 61 posts
  • LocationUK

Posted 07 December 2012 - 07:12 AM

Updated functions, also, please post any example programs :)

#3 Stupidcreeper123

  • Members
  • 6 posts

Posted 08 December 2012 - 07:16 AM

Looks cool I've tried making GUIs before but there just a bit beyond my level of lua so this might help quite a lot :D

It Worked

#4 kylergs

  • Members
  • 61 posts
  • LocationUK

Posted 08 December 2012 - 08:51 AM

Thanks for the response, anything I can do to make your life easier?

I plan on making a few example / stock programs for it such as file navigators (with extensions), menus from text files etc

#5 kylergs

  • Members
  • 61 posts
  • LocationUK

Posted 09 December 2012 - 08:17 AM

Fixed Argument problems in post

#6 makerimages

  • Members
  • 236 posts

Posted 09 December 2012 - 09:05 AM

hmm, this could use better function explanation...

#7 kylergs

  • Members
  • 61 posts
  • LocationUK

Posted 09 December 2012 - 09:28 AM

How so? Which parts are confusing?

#8 makerimages

  • Members
  • 236 posts

Posted 09 December 2012 - 10:03 AM

ths still runs off of menu elements ina text file?

#9 kylergs

  • Members
  • 61 posts
  • LocationUK

Posted 09 December 2012 - 10:13 AM

No, this is just an API, everything has to be entered within the program

#10 kylergs

  • Members
  • 61 posts
  • LocationUK

Posted 09 December 2012 - 10:48 AM

Haha thanks, any improvements needed?

#11 Sammich Lord

    IRC Addict

  • Members
  • 1,212 posts
  • LocationThe Sammich Kingdom

Posted 09 December 2012 - 02:31 PM

Me <3 this :D

#12 kylergs

  • Members
  • 61 posts
  • LocationUK

Posted 10 December 2012 - 04:07 AM

Quote

Well first off, can the "---------" horizontal lines just be White pixels? It'd look pretty!
Thats a good idea, at the moment its in a sort of Non-colour computer compatibly mode

edit: I'm not too sure....

Spoiler


Edit 2 : But what do you thing about this? :

Spoiler


#13 kylergs

  • Members
  • 61 posts
  • LocationUK

Posted 10 December 2012 - 08:26 AM

Updated overlay stuff - next, general background for the menu, a scroll bar, better mouse detection and tool-bars (useful for OS's)!

#14 Sammich Lord

    IRC Addict

  • Members
  • 1,212 posts
  • LocationThe Sammich Kingdom

Posted 10 December 2012 - 08:28 AM

Keep up the good work!

#15 kylergs

  • Members
  • 61 posts
  • LocationUK

Posted 10 December 2012 - 08:29 AM

Haha thanks. I would do more but Exams ...

#16 kylergs

  • Members
  • 61 posts
  • LocationUK

Posted 11 December 2012 - 03:00 AM

Added more customisability - 1.3. Background Colours and stuff

#17 Jode

  • New Members
  • 3 posts
  • LocationMA, US

Posted 16 December 2012 - 10:01 AM

Looks awesome. If I don't use this, I'll definitely learn something from examining the source code.

Also, the text of the code link (which is valid) is different from where it actually leads (which is not)?

#18 kylergs

  • Members
  • 61 posts
  • LocationUK

Posted 17 December 2012 - 08:22 AM

Glad that I helped, not sure what happened with the link :)

#19 apoc123

  • Members
  • 34 posts

Posted 05 January 2013 - 05:19 PM

Im a noob sorry if noob question.

to add this api do i name it what ever or name it guiapi for first pastebin then menu or colors for the name of the second file.

does the name matter when manually placing your api in the lua/api directory

#20 kylergs

  • Members
  • 61 posts
  • LocationUK

Posted 12 January 2013 - 03:57 PM

The name of the api doesn't matter





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users