Lua Widgets 0.4(BETA)

Demon666 - Custom level - from Windows
PlayEdit22 players liked this.Log in to like this level.

All elements are moveable/scaleable/colorable(limited)/etc
outputs values identical to the normal RC widgets

fell free to suggest other widget types that dont exist in principia at all

- Button
- Slider
- Dials
- Joystick
- Toggle Switch
- Expandanble Menu
- iPod-style clasic scroll-wheel

Update 0.4
- vertical scroll-bar for options menu
- scrollbar only visible of the menu grid is larger then the max height
- iPod-style clasic scroll-wheel

future updates
- deactivate toggle
- option for static onscreen position
- make them scale depending on zoom level
- icon support for options menu
- singular widget controler table/functions

Views: 1298 Downloads: 427 Unique objects: 1 Total objects: 3

Discuss this level

Log in to comment on this level.
  • principiafreak300: @JupiterSky: Yeah that's right :)
  • JupiterSky: @principiafreak300: just thought it could be useful in the future. We already have the keyboard too so... It would be cool for a mouse though. That one widget works like a mouse trackball.
  • principiafreak300: @JupiterSky: I'm not sure, maybe we'll need that later, but at the beginning the system will only be text-based like the early Unix or DOS
  • JupiterSky: @principiafreak300
  • Golden: @Demon666: for my agario project, but that's fine, I don't need it. I have to solve the problem that cannot eat sprite.
  • Demon666: @Golden: ? xD
  • Golden: OK this is complicated but I was trying to get sizeable hollow circle joystick xD
  • JOELwindows7: Duper Awesome!
  • Demon666: @Golden: you do know you can just look up lua math library on google to get a full list of math(dot) functions lol.....
  • Demon666: @Golden: yeah i know it could be easier but it will also be more laggy because the sprite sheet that generates the texels would need to be multiplied by w/e number of luascript objects you have lol
  • Demon666: @Golden: the dial take the place of a joystick(and i like the way it looks more xD).
  • Golden: And I learned about math.abs() is math.absolute() xD
  • Golden: Can you add joystick? It might be useful for prize crane, and separate lua for separate widgets would be easier for people
  • that guy2: I'm pretty sure I saw something on the wiki about screen draw coordinates...
    this:set_draw_coordinates(1) and then x/y are scaled 0-100 for that far across the screen. I'm pretty sure the game window is around 16:9 aspect ratio, so it'd be simple math.
  • principiafreak300: @Demon666: To keep it on the screen you can set the pos relative to the cam pos I think
  • principiafreak300: @Demon666: To keep it on the screen you can set the pos relative to the cam pos I think
  • Linux: @Demon666: 👏bravo keep up the good work
  • Demon666: @BobMonkeypimp: i could imagine using a classic ipod click-wheel to control a car lol. that seems interesting aswell.
  • Demon666: @BobMonkeypimp: somehow thinking about this gave me the idea to make a scrolling menu so thanks for that lol. i also look into the steeing wheel. might look weird tho.
  • Demon666: @BobMonkeypimp: lol thats gonna be difficult. i suppose i could map a regular sliders coded onto a pivoting half circle. it would be very unnatural to use unless your controlling a car from top view. like this
  • BobMonkeypimp: How about a slider than can also be tilted left & right (with a pivot point at the bottom)? It would be an interesting way to control throttle and steering.
    Love the keypad widgets by the way, I could see them being really good in an espionage style adventure level.
  • that guy2: @Demon666: If these are finished in time for the contest, I may end up endorsing them in my build.
  • Demon666: @principiafreak300: coloring as nothing to do wity it. that can be adjusted anytime. i need to be able to set them up like normal widgets and not have them move around
  • principiafreak300: @Demon666: Ok, the coloring isn't the best
  • principiafreak300: @Demon666: Why?
  • Demon666: @principiafreak300: thanks but these are still far from being practical to use.
  • principiafreak300: I think, these widgets should be in the top 5 lua builds in principia.
  • JOELwindows7: @Demon666: great! Corrected.
  • Demon666: @JOELwindows7: correcting*
  • JOELwindows7: @Demon666: ok.
    Wait "Contrains"?! Did you mean contains?
  • Demon666: @JOELwindows7: a large square joystick can easily function as a touchpad and a toggle switch takes the place of a toggle button... i dont feel the need to have multiple widgets that have the same functionality.... adds more lag and takes up space lol... i don't plan to do anything resembling a keyboard anytime soon but that doesn't mean never.
  • JOELwindows7: Duper Awesome! Duper Awesome! Duper Awesome! Duper Awesome! Duper Awesome!
    Add the touchpad, keyboard, toggle button (other than flick switch) widget
  • Demon666: @BobMonkeypimp: thanks
  • BobMonkeypimp: Very nice!
  • Demon666: @Linux: was already gonna do something like that
  • Linux: @Demon666: a side bar that when it's pulled displays widgets in it
  • Linux: @Demon666: idea slider bar for widgets
  • Demon666: @Aceheliflyer: thanks lol
  • Demon666: @leo3065: as do I but vectors aren't supported yet xD
  • leo3065: Great! But for dials I prefer vector over raster ;)
  • Aceheliflyer: Really cool!
  • Aceheliflyer: I just realized, you could make an infinate ammount of UI outputs with these instead of using the RC MONSTRO. O_o
  • Demon666: @that guy: yeah they are function based and they retain their own variables in a table. each widget has an ID that links it to the variables in the table.
    the variables/table are all self-managing so you wouldn't need to worry about adding them yourself. only thing you need to do it make sure you use a different ID
    for each instance of a widget you use. focused,value=slider(id,x1,y1,scale,a,l,color1(background),color2(grip)) ID is the first variable in the function so its easy to keep track of. and the focused and value variables will return the same types of numbers as a regular RC widget slider would.
  • that guy2: @Demon666: I just meant in the lua variables, such that I could emulate the springy slider and such based on them without any wiring on the lua.
  • Demon666: @GlaDos:nah just tedious lol
  • Demon666: @stardustdestruktor: thanks lol
  • Demon666: @that guy: i designed them to return focused(0 or 1),value1,(0-1). the square joystick is the only one that returns a value2 aswell... dont know what you mwan by internal tho lol
  • that guy2: Are there internal ways to emulate focus and value setting like on RC monstro?
  • stardustdestruktor: Nice
  • GlaDos: It would be a long work
  • Demon666: @Golden: @GlaDos: thanks... honestly I'm amazed that it took me to long to do this lol...
  • Golden: Interesting
  • GlaDos: Wow awesome

LEVEL ID: 21520