edited February 2017 in ORK Support
Howdy,

so I am noticing that the UI in it's current state cannot do what I need it to do. Specifically, I'm designing some menu's and HUD's that have buttons in different parts of the screen.

So my questions are the following:
1. Am I missing something? For example, you can create a complex arrangement of buttons using menu screens, but not HUD's, is that right? So the proper way to create a complex arrangement is to use a menu screen built of gui boxes, is that right?
2. Why can we not call a function from button presses? why is it limited to summoning other menus, save/load, global events, and exiting? What if you want a button to do something specific?
3. How do i add other non-button things like sliders, etc? I see the slider prefab in the gui skin, but i dont see anywhere to add a slider in the gui box, nor do i see how to attach the value of a slider to a specific variable.
4. is it possible to design your own GUI (the way its normally done), then attach that GUI to the ORK event system and canvas?
Post edited by chud575 on
  • 1) This ultimately depends on what you want to do. Menu screens are for things that are menu-ish, HUDs are for displaying information - but you can kinda mix these as well.
    Using HUDs to work as buttons is also possible, either by using Control HUDs (which would trigger global events that do what you need when triggered by the input keys the HUD uses) or Information HUDs that use a Click Action to call menus or global events.
    You could also do a custom system using the event system or just scripting something yourself :)

    2) Well, simply because it's not implemented (yet). While I'd love to add every functionality everywhere, that's way overboard :)
    Having a button press call a global event already makes pretty much everything doable already.

    3) You can use Value Input Dialogues in the event system for this.

    4) Well - yes. ORK creates a canvas as a child object of the _ORK game object, so you can stick your stuff on that.
    You can also start ORK event interactions from your new UI buttons using the start type UI for that. On your button, add an On Click () setting, select your game object and the function Event Interaction > UIStart.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • 2) Well, simply because it's not implemented (yet). While I'd love to add every functionality everywhere, that's way overboard :)
    Having a button press call a global event already makes pretty much everything doable already.
    That's fine and fair - so let me ask this. Assume you create a 2 button HUD. One will push an object up, the other down. You can tell the buttons to call a global event, that can do the dirty work or pass on the logic to a script (if needed), but what you can't do is discern which button was pressed, because you can't set local or global variables before calling the event. Which means you'd need 2 global events just to satisfy a silly if/then condition, and the more directions you handle, the more global events you need. Is that something you can address? Or am i missing something and we can do that already?
    4) Well - yes. ORK creates a canvas as a child object of the _ORK game object, so you can stick your stuff on that.
    You can also start ORK event interactions from your new UI buttons using the start type UI for that. On your button, add an On Click () setting, select your game object and the function Event Interaction > UIStart.
    the canvas object is private, even though the guihandler is accessible. So i'd have to gameobject search for 'Canvas'. Not very elegant. Mind adding an accessor to the class on the next update?
  • 2) If you use a Control HUD, you can handle it by a single event that's checking the used input keys and do stuff based on that.

    4) I'll add direct script access to the canvas in the next update. For now you should be able to access it by searching for the _ORK game object and using the Canvas child object.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • edited February 2017
    Ok, so I've managed to get this working two different ways:
    1. Using a control hud, as you mentioned. However after digging through the code, I don't see a way to summon a HUD. I assume this is because HUD's are summoned through their display conditions, which means if i want to push a specific block at a specific time, i should set a game variable that will enable/disable the HUD. Do I have the gist of that?
    Another Question: HUD's have the advantage over GUI Boxes of having elements draggable/adjustable in the GUI editor, but Control HUD's have the disadvantage of not using UI buttons, instead opting for image overlay. Is that the final verdict on HUDs or do you believe you will add buttons to the system at some point?

    2. The other solution was to create a GUI box with the positions of the buttons that would be used (instead of a list), then propogate those buttons in an event through a choice dialogue box. So that will do for now.
    Another Question: However, GUI Box buttons can only be of one type of prefab. So if i wanted to use a button with an up graphic, and a separate down button graphic, i wouldn't be able to accomplish this (unless i used the less elegant control HUD images). Is there a way to set a prefab for each button?
    Post edited by chud575 on
  • edited February 2017
    Another Question: However, GUI Box buttons can only be of one type of prefab. So if i wanted to use a button with an up graphic, and a separate down button graphic, i wouldn't be able to accomplish this (unless i used the less elegant control HUD images). Is there a way to set a prefab for each button?
    On your button prefab, see if you can: Add Component > UI > Button Extended (I think this is packaged with Unity by default). It has a Sprite Swap option. I like the Color Tint option because the transitions are smoother with Fade. The only problem with going this route is that you are overlaying ORK text on top of your generic button, so the text won't have any transition effects.
    Post edited by SilverFlame on
  • You can create different button prefabs (up graphic, down graphic, etc) and assign them to your particular GUI box. There is a checkbox to override the default GUI. When you check that, you can assign your custom prefab to the button for that GUI box.
    I've done this for a few of my GUI boxes and it works great.
  • chud575 said: Another Question: HUD's have the advantage over GUI Boxes of having elements draggable/adjustable in the GUI editor, but Control HUD's have the disadvantage of not using UI buttons, instead opting for image overlay. Is that the final verdict on HUDs or do you believe you will add buttons to the system at some point?
    So far there are no plans for having buttons in HUDs.
    chud575 said: Another Question: However, GUI Box buttons can only be of one type of prefab. So if i wanted to use a button with an up graphic, and a separate down button graphic, i wouldn't be able to accomplish this (unless i used the less elegant control HUD images). Is there a way to set a prefab for each button?
    No, the buttons of a GUI box use the same prefab and only display different content (e.g. using icons). You could probably fake it by using no button prefab (or one without a graphic) and have an icon look like a button graphic.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • SilverFlame said: see if you can: Add Component > UI > Button Extended (I think this is packaged with Unity by default)
    @SilverFlame it isn't. Where did you get this script? I'm not seeing it in a google search
    keyboardcowboy said: You can create different button prefabs (up graphic, down graphic, etc) and assign them to your particular GUI box. There is a checkbox to override the default GUI. When you check that, you can assign your custom prefab to the button for that GUI box.
    I've done this for a few of my GUI boxes and it works great.
    @KeyboardCowboy okay, good idea - but how do you execute this path? If you have two GUI Boxes, each with a separate button, how do you use the event system to make both appear and handle input at the same time? From my experience summoning a choice dialogue waits for the choice to complete before going to the next node.
Sign In or Register to comment.