Log In  


Cart #picogui_demo-1 | 2022-08-12 | Code ▽ | Embed ▽ | No License
8


Cart #picogui_ball_demo-1 | 2022-08-12 | Code ▽ | Embed ▽ | No License
8


Updated Release 1.1 (No longer being updated)


About
Pico-GUI is an object based ui library useful for debugging games or creating development tools. This was made in just one day, and there may be some bugs or important missing features.

Currently the system is at 891 tokens. I'm not the best at crunching down token counts, so if someone manages to save more tokens, let me know and I'll probably update the main post with that version


Widgets
Widgets are any interactable UI element.
By default, Pico-GUI supports Panels (windows), Sliders, Buttons and Toggles.


Core - ui_core( )
Can be used for storing all GUI elements. Allows for focusing widgets and easy widget management

Functions:

  • add( widget, widget, ... )
  • render( )

Attributes:

  • [content]
    Table of all widgets contained within the panel

Panels - new_panel( x, y, width, height, [col] )

Functions:

  • add( widget, widget, ... )

Attributes:

  • [content]
    Table of all widgets contained within the panel

  • [col]
    Background color of the panel

  • [border]
    Color of the border (false for no border)

  • [moveable]
    Decides if the panel can be moved

  • [resizable]
    Decides if the panel can be resized

  • [locked]
    Toggles if panel can be resized/moved

  • [min_width]
    Minimum panel width

  • [min_height]
    Minimum panel height

  • [title]
    Name to be displayed

Sliders - new_slider( x, y, width, min, max, default, [col] )

Attributes:

  • [col]
    Color of slider notch

  • [_min]
    Minimum value slider can be set to

  • [_max]
    Maximum value slider can be set to

  • [_range]
    Range between minimum and maximum value (max - min)

  • [_value]
    Value slider is currently set to

Checkboxes - new_checkbox( x, y, [col], [toggled?] )

Attributes:

  • [col]
    Color of toggle when enabled

  • [toggle]
    Stores the state of the toggle

Buttons - new_button( x, y, width, height, [sprite], [col], [rounded?], [callback] )

Attributes:

  • [col]
    Background color of button

  • [sprite]
    Image displayed on button

  • [rounded]
    Enable rounded corners

  • [callback]
    Function to call when pressed

8


dang this is cool


i do not know how to use this :(


Very nice! I noticed that in code there's a variable called select, I think it should be renamed to something else so it doesn't get highlighted as green in editor (I assume it doesn't actually overwrite the function as it's a local variable)



[Please log in to post a comment]