shdwcat / YUI

YUI - A UI system for GMS2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Streamline getting started -- make it so you can drop one object into a room to get started

shdwcat opened this issue · comments

Adding YUI to an existing game is currently a bit complicated (and not actually documented on this wiki). Ideally there should be something like a 'my_first_yui_screen' game object that you can drop into a room and have it render UI for you right away.

Additionally, figure out if there's some way to bootstrap the persistent global object like YuiCursorManager instead of requiring manual setup of those.

Current instructions for getting started for reference:

The steps for setting it up in your own game are (roughly):

  1. Add the necessary persistent objects to your loading room
  • YuiGlobals, YuiCursorManager (I think it's just those two, you could check the example project)
  1. configure live reload (there's a folder labeled 'configure me!' with a gml file with instructions. (you should do this for the example project as well)
  2. Create a .yui screen file (see the example screen folder for what this should look like) and put it in the YUI subfolder in /datafiles/
  3. Put a yui_document game object into a room somewhere. Probably easiest to start with your loading room.
  4. In the variables section, Set the yui_file variable to the path to the screen file relative to /datafiles/ (including the YUI subfolder).
  5. Then you the need to either resize that object to the size of the UI you want, or check the draw_fullscreen box
  6. Set the data_context variable of that yui_document to some instance (or instance variable pointing to a struct). This is essentially how you get game data into the UI. All the UI data binding stuff will be referring to data on that object, or available from it via variables.

Theoretically, at that point you run the game and the UI shows up. If you change any variable values on that data_context object, the UI will immediately update without you needing to do anything
Live reloading is explained on the wiki, but assuming it's set up correctly, you can just press F5 and it will reload the UI from disk. Right now it will crash if you fucked up somewhere, but I've got some stuff in Dev that in some cases will make it so that you can fix the problem and reload again