playMaker

Author Topic: Creating Universal GUI's  (Read 4315 times)

SirGatlin

  • Playmaker Newbie
  • *
  • Posts: 17
Creating Universal GUI's
« on: June 17, 2013, 08:18:51 PM »
So I am making an app that is an image sequence with invisible buttons over top items that I want to be clickable. I built it to work for Ipad and everything works great, only problems is now I am trying to make it work for Iphone5 and the buttons are being misplaced and are no longer in the position I want them to be. How do I go about fixing this? will I need 2 different GUIs of invisible buttons one to load for ipad and one to load for iphone?

escpodgames

  • Hero Member
  • *****
  • Posts: 687
    • Assets
Re: Creating Universal GUI's
« Reply #1 on: June 17, 2013, 09:13:10 PM »
That would depend on how you built the UI - Most people use NGUI but I've just built a UI using 3D elements for many reasons, one being switching to other resolutions doesn't have the same effect.

I have a device manager for my UI which sets the scale of the top node of every UI Screen ... iPhone5 is 0.88, while iPad and iPhone4 are set to 1, from there its just a matter of a few more tweaks but I've built it in a way that I could set the position of every element per resolution and all the animation etc will still work.

SirGatlin

  • Playmaker Newbie
  • *
  • Posts: 17
Re: Creating Universal GUI's
« Reply #2 on: June 17, 2013, 09:22:49 PM »
Im just using the playmaker GUI Button action to make my buttons, since is was the easiest way to make invisible buttons. I just have a looping image sequence with invisible buttons over the top.

escpodgames

  • Hero Member
  • *****
  • Posts: 687
    • Assets
Re: Creating Universal GUI's
« Reply #3 on: June 17, 2013, 10:24:06 PM »
Oh right - Invisible buttons are easy without GUI, create an empty gameobject and add a box collider, tag the gameobject with "Button_Back" or what you want it to do.

Then create an input manager FSM that mouse picks the button and checks the tag and then moves the image sequence back.
One of the great things about this is you can change the tags of gameobjects for any reason.

escpodgames

  • Hero Member
  • *****
  • Posts: 687
    • Assets
Re: Creating Universal GUI's
« Reply #4 on: June 17, 2013, 10:31:33 PM »
But your example is pretty simple and I'm sure GUI is the answer

What you want to do is change the GUI buttons per resolution, Use the screen height or/and width actions to get the screen resolution and then set the GUI buttons based on that.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Creating Universal GUI's
« Reply #5 on: June 19, 2013, 02:05:50 AM »
Hi,

 Most 2d plugins like ngui, 2d toolkit provide multi screen possibilities, and generally anchoring to screen corners for example.

 so instead of hardcoding position on screen, you should have "panel" that anchors to screen corners and in there have hard coded position, then it will adjust properly based on screen size.

bye,

 Jean