playMaker

Author Topic: How to manage lots of UI Button changes  (Read 646 times)

Athin

  • Full Member
  • ***
  • Posts: 147
    • View Profile
How to manage lots of UI Button changes
« on: August 08, 2019, 08:28:00 PM »
Hey guys,

I've always struggled with how to handle UI buttons constantly activating/deactivating with my RTS project and was looking for some advice.  My basic setup currently is whenever you click on a unit/building, that send an event to activate X buttons in an array and also hands them an Int Button ID . When X button is clicked, it shoots that button ID to a logic check FSM to see what action to do.

This works for the most part but is very chunky and bulky as I have to reset icons and values constantly.

Thanks for any help anyone can give!


jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15370
  • Official Playmaker Support
    • View Profile
Re: How to manage lots of UI Button changes
« Reply #1 on: August 12, 2019, 01:15:36 AM »
Hi,

UI is very heavy on handling, so don't be surprised by this, simple hello world always look simple, but when you actually want a proper UI, a lot of work is required, and often completly overlooked in favor of the gameplay itself...

your implementation sound good.  I usually make sure my events reflect where they come from so :

XXX / ON BUTTON CLICK

then my logic will catch this and maybe send more events related to XXX

XXX / EXECUTE

Things like that.

 Bye,

 Jean

Athin

  • Full Member
  • ***
  • Posts: 147
    • View Profile
Re: How to manage lots of UI Button changes
« Reply #2 on: August 13, 2019, 08:51:38 PM »
Thanks Jean!

At least now I know I'm on the right path.  There is very little online for UI tutorials other then the simple 1-3 pop up windows.  I was just worried I was missing something huge and was doing it the hard way.  Sounds like UI in general is just bulky. 

Will try your tips as well.  May save me a few headaches once I get a few layers deep in UI :)

Thanks

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15370
  • Official Playmaker Support
    • View Profile
Re: How to manage lots of UI Button changes
« Reply #3 on: August 13, 2019, 10:49:25 PM »
Hi,

 Check out the meface sample on the ecosystem, it has a complex ui

https://twitter.com/jeanatplaymaker/status/968773939630571520?lang=bn


and it can't get worse in terms of two way bindings between UI and content.

 Bye,

 Jean