Search Unity

EZ GUI - Powerful, Low draw call GUI solution

Discussion in 'iOS and tvOS' started by Brady, Jun 3, 2010.

  1. randyherring

    randyherring

    Joined:
    Feb 9, 2008
    Posts:
    42
    I posted this on the new EZGUI forum also:
    I just tried setting my EZGUI project in Unity 3.0 beta to iphone and get several complier errors.
    First, I want to tell you you have a wonderful product. I bought all 3 :)
    This is not a complaint, just a query as to when you plan to have a build for Unity 3. I just received Unity 3 myself, so I understand it will take time (I am a developer many many years supporting products so I get it).

    Thanks again for the wonderful product.
     
  2. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    Randy,

    I've been able to get EZ GUI working under 3.0b2 (I've not tried b3). Have you checked some of the first check things like .net? (Tho' it b3 may not allow .net 1.x) Check the doc's for some troubleshooting notes on setting up for the iPhone. There are some settings that need to be configured in the new target platform.
     
  3. randyherring

    randyherring

    Joined:
    Feb 9, 2008
    Posts:
    42
    Yes, I tried those. The current Unity 3.0 beta does not have a setting for .Net 2.1, it has 2.0 and 2.0 subset, neither of which help.
     
  4. Hesham

    Hesham

    Joined:
    May 29, 2008
    Posts:
    147
    same here with b3
     
  5. kirua-sama

    kirua-sama

    Joined:
    Mar 21, 2010
    Posts:
    41
    Sorry to ask about that. But I think that I have seen a tutorial video where Brad is creating the sample scene (Fire).

    I cannot find it anymore, could someone tell me where I can find it please ?
     
  6. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
  7. kirua-sama

    kirua-sama

    Joined:
    Mar 21, 2010
    Posts:
    41
    Thx, I was actually looking for the scene ^^.
    I found it, My fault.
     
  8. Brady

    Brady

    Joined:
    Sep 25, 2008
    Posts:
    2,474
    Well, I did say some of those items might wind up in the next release after all... ;)


    Yes, new tutorials will be an ongoing thing for a good while until all the major (and even many minor) topics are covered pretty well.

    As for a deadline for the next release, I'm hoping within the next couple of weeks.


    No, I don't have any kind of post review requirement. So I'm not sure why it didn't post. Though I just did some replies and noticed one of my replies didn't show up either and had to re-type it, at which point it worked. So I don't know if my web host's MySQL is acting up or what... I guess we'll see if it persists.

    As for the specific issue, it sounds like a Unity issue to me since there isn't any EZ GUI involved. Or am I missing part of the issue?
     
  9. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    It felt like a Unity thing, but I posted about it on the off chance that it wasn't.
     
  10. kirua-sama

    kirua-sama

    Joined:
    Mar 21, 2010
    Posts:
    41
    Hi,

    I have one more question concerning EZ Component.
    Is there a quick way to know if the mouse is on a GUIElement or must I shot a ray and check it.

    'Cause I'm using

    Code (csharp):
    1. if(Input.GetMouseButton(0))         // Left mouse button active : rotate around the ray impact
    2.  
    3.         {      
    4.  
    5.             mouseMove.x += Input.GetAxis("Mouse X") * moveSpeed;
    6.  
    7.             mouseMove.y -= Input.GetAxis("Mouse Y") * moveSpeed;
    To move my camera all arround the scene, so I just want to know if I can find something like :

    if(MouseOnEZGUI())return;

    To avoid having action on the scene when I'm focused on a GUI element.

    Thank you very much.[/code][/quote]
     
  11. Brady

    Brady

    Joined:
    Sep 25, 2008
    Posts:
    2,474
    Probably the easiest way to do that currently is to register a PointerInfoDelegate delegate with the UIManager like so:

    Code (csharp):
    1.  
    2. // C#
    3. POINTER_INFO currentMousePtr;
    4.  
    5. void MouseGUI(POINTER_INFO ptr)
    6. {
    7.    currentMousePtr = ptr;
    8. }
    9.  
    10.  
    11. // Probably in Start():
    12. UIManager.instance.AddMouseTouchPtrListener(MouseGUI);
    13.  
    14.  
    15. // Probably in Update():
    16. if(currentMouse.Ptr.target == null)
    17. {
    18.    // No GUI element is under the mouse
    19. }
    20.  
    AddMouseTouchPtrListener() adds your delegate to the list of "listeners" that get notified of all mouse or touchpad pointer input. So when the mouse is polled, the delegate gets the POINTER_INFO struct that contains info on the pointer. The info you're after here is the "target" member of the struct, which holds a reference to the control underneath the mouse, or in the case of a drag operation, the control that the mouse was over when it was first clicked. So if .target is null, then no GUI object exists underneath the mouse.
     
  12. kirua-sama

    kirua-sama

    Joined:
    Mar 21, 2010
    Posts:
    41
    I cannot find any information about "AddMouseTouchPtrListener" :

    I found something else :
    Code (csharp):
    1. public PointerInfoDelegate SetNonUIHitDelegate(PointerInfoDelegate del)
    2.  
    3.     {
    4.  
    5.         PointerInfoDelegate oldDel = informNonUIHit;
    6.  
    7.         informNonUIHit = del;
    8.  
    9.         return oldDel;
    10.  
    11.     }
    what do you think about trying to use this function ?
    Thanks for your help.
     
  13. Brady

    Brady

    Joined:
    Sep 25, 2008
    Posts:
    2,474
    Sorry, I forgot to mention that AddMouseTouchPtrListener is in some of the later betas (e-mail me directly and I'll send it to you since the Google group downloads are flakey at the moment).

    You could use that other method, but you'd have to change the way you did things just a bit. Basically, you can register a delegate with that method and it will only call your delegate when a non-UI collider was hit by the pointer or pointers (in the case of touchpad). So you would need a non-UI collider in front of the camera.
     
  14. kirua-sama

    kirua-sama

    Joined:
    Mar 21, 2010
    Posts:
    41
    I have an other question about ScrollList this time, like I cannot access to any tutorial.

    I'm trying to make a list of button and link function to each item. So, I have to pass throught evry item and attach the Delegate. The problem is that list.item is not in a public access.

    I currently add accessors to have access and am doing this :
    Code (csharp):
    1. // Add list items: 
    2.  
    3.         foreach(string item in (List<string>)DynamicMenu.Dictionnary[btn.name])
    4.  
    5.             list.CreateItem(itemPrefab, item);
    6.  
    7.        
    8.  
    9.         foreach(UIButton button in list.Items)
    10.  
    11.             button.SetValueChangedDelegate((EZValueChangedDelegate)dictionnary[btn.name]);
    12.  
    13.            
    14.  
    15.         // Select the first item by default
    16.  
    17.         list.SetSelectedItem(0);
    But I'm wondering if it is the good solution cause it just look like a trick for quick usual stuff.
    Thanks for answers :)
     
  15. Quallity

    Quallity

    Joined:
    Jul 16, 2010
    Posts:
    20
    Hey!
    I've purchased ur program and I already spent like 5hours, and I've some problems.
    1. What's ur e-mail? :)
    2. When I add buttons, like images,etc.. to the material place so when the image appears in the scene/game (doesn't matter) the quality is REALLY bad.
    3. Moreover, I saw the demo and I was interested how did you create the buttons,scrollbars all in ONE texture? like a sprite or something..
    I didn't see any video or anything explaining about it..

    ----
    Your program until now is amazing,Good job!I wish I could spend some months on it(but im not good enough at programming :()
    I'll finish GUI projects faster now, but with the issues about I just cannot. Please answer ASAP I really want to continue developing it already!

    Thanks!
     
  16. Quallity

    Quallity

    Joined:
    Jul 16, 2010
    Posts:
    20
    2. Solved.. what I did was adding the texture to the material -.- , I need to add it to somewhere else and the click ALT+a, I mean build atlas, then the texture adds automatically to the materil as a "sprite", correct me if im wrong :]
    3. same, atlas...
    GIMME UR EMAIL :] lol
     
  17. Lokken

    Lokken

    Joined:
    Apr 23, 2009
    Posts:
    436
    I could have sworn the support email is either the sender of the email you get after purchasing it or it is included in that email.
     
  18. Quallity

    Quallity

    Joined:
    Jul 16, 2010
    Posts:
    20
    ty
     
  19. Brady

    Brady

    Joined:
    Sep 25, 2008
    Posts:
    2,474
    Actually, you can use the list's GetItem() method. If it isn't in your version, e-mail me (use the address listed in your order confirmation e-mail) and I'll send you the latest beta.


    @Quallity

    For image quality issues, be sure to see the Troubleshooting section of the EZ GUI docs.

    But a few things to check are:
    1) Are you using any kind of image compression? (Check the settings of the atlas texture.) PVRTC compression, for example, is notoriously bad in terms of preserving image quality, and is enabled by Unity by default in iPhone projects.

    2) Make sure you don't have more graphics being built to an atlas than will fit on that atlas. If you have more graphics than will fit on the max texture size, all graphics will be automatically halved to make it fit. But you will receive a warning message if this occurs so you will know to fix it. In such a case, just move some of your other controls/sprites to a different material. This will cause a second atlas to be used.

    There are lots of other good suggestions in the Troubleshooting section. I hope that helps. Thanks!
     
  20. Quallity

    Quallity

    Joined:
    Jul 16, 2010
    Posts:
    20
    where the troubleshooting section?
    this link doesnt work :
    http://www.aboveandbeyondsoft.com/support/faqs.htm
     
  21. Brady

    Brady

    Joined:
    Sep 25, 2008
    Posts:
    2,474
    It is in the docs that are shipped with EZ GUI. There is an "EZ GUI Docs.zip" file included in the package you received. Just unzip that and open index.html.
     
  22. Quallity

    Quallity

    Joined:
    Jul 16, 2010
    Posts:
    20
    Except EZGUI Docs\scripting I don't see anything useful there.
    Good night, time to sleep ;)
     
  23. Brady

    Brady

    Joined:
    Sep 25, 2008
    Posts:
    2,474
    Open index.html. Look on the left side and you will see a troubleshooting section.

    I just realized some of the image quality topics aren't in the current release of the docs. Sorry about that. Here's some of what should have been in there (will be added in the future):

     
  24. Quallity

    Quallity

    Joined:
    Jul 16, 2010
    Posts:
    20
    Oh my .. god!
    This is just amazing!!!
    Thank you!!!!
     
  25. Quallity

    Quallity

    Joined:
    Jul 16, 2010
    Posts:
    20
    Solved.
    Damm.. I was so stupid..
    I spent some hours on something, and now i finished it within less than an hour.. :]
    Every day I learn more and more EZGUI :)
    amazing..
     
  26. Hesham

    Hesham

    Joined:
    May 29, 2008
    Posts:
    147
    Yes EZGUI is just amazing
     
  27. Quallity

    Quallity

    Joined:
    Jul 16, 2010
    Posts:
    20
    Is there a feature to the toggle button called "on hover"?
    because there's just checked,unchecked,disabled..
     
  28. hxx2010

    hxx2010

    Joined:
    Aug 31, 2009
    Posts:
    155
    unity iphone 1.7
    My creating an auto-hide toolbar, and using the transition editor to animate
    UIManager
    POINTER TYPE : MOUSE - Seems normal, but can not keep installed at the end of
    Pointer Type : TOUCHPAD - Without any corresponding
    POINTER TYPE : TOUCHPAD_AND_RAY - Real error

    UIManager.cs
    UnityException: Index out of bounds.
    UnityEngine.iPhoneInput.GetTouch (Int32 index) (at /Users/build/builds/unity-iphone/iphone/Runtime/Export/Generated/iPhoneInput.cs:94)
    UIManager.PollTouchpad () (at Assets/Plugins/EZ/GUI/Management/UIManager.cs:875)
    UIManager.PollTouchpadRay () (at Assets/Plugins/EZ/GUI/Management/UIManager.cs:1030)
    UIManager.Update () (at Assets/Plugins/EZ/GUI/Management/UIManager.cs:608)
     
  29. Brady

    Brady

    Joined:
    Sep 25, 2008
    Posts:
    2,474
    Unfortunately, at the moment there is not. Only UIButton and derived objects (as well as interactive panels) support "over" states. I have adding "over" states to toggles and radios on my list of possible additions, however.


    @hxx2010
    I'm sorry, I don't think I understand your problem. Can you describe the problem in more detail?

    Also, e-mail me directly and I will send you 1.1 beta 9 which might address whatever problems you are having (be sure to include your order reference number in the e-mail).

    Thanks.
     
  30. rattatat

    rattatat

    Joined:
    Jul 19, 2010
    Posts:
    1
    I think I must be missing something, here is my problem -

    I have a button inside a panel and understand that its not rendered in the screen but in the scene. So on page 6 or so of this topic someone mentioned just put it in front of the camera and make it a child of the camera.

    Problem with that is when I run around lets say the terrain gets between the camera and the button it disappears. I am trying to get the button on the top left of the screen which means it cant be right up against the camera has to be out and to the left just slightly.

    Is there a way to attach this so its always in the correct spot(in my case upper left corner) and always stays there nothing can come in front of it?

    This is probably something simple and noobish but I am a noob here :)
    Thanks!
     
  31. SquaxShaun

    SquaxShaun

    Joined:
    Jun 22, 2009
    Posts:
    63
    Just got it, looks ace. Doesn't work with beta3 though, loads of Editor warnings.
     
  32. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    I'm trying to reply to a post on the AnBSoft forums, and I just can't...

    I'm getting either a zombie response ( it seems to try and post but nothing appears... ) or more commonly "The submitted form was invalid. Try submitting again."

    My timestamp is 1 hour out of synch with the forum, but I can't change it. I did successfully change the skin - once - but can't change it back... skuppered!
     
  33. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    Grimmy:

    Check your camera. Make sure that the "Mouse and Touch Mask" includes the gameworld layer of your 3D object and make sure that your UI Cameras array includes both your main camera and ui camera if you are using 2 cameras.
     
  34. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    rattatat:
    Experiment with 2 cameras, one for rendering your 3D gameworld and another for (preferably orthographic) camera for rendering your UI. Put all the UI buttons on a unique layer and have your UI Camera only render that layer and have your main camera ignore that layer.

    Look back a few pages and you'll see some discussion about it.
     
  35. marty

    marty

    Joined:
    Apr 27, 2005
    Posts:
    1,170
    Hey, all.

    I own EZGUI but never got any info on the google group.

    Any chance one of you could let me know what it's called so I can join. It'd be great to have an up-to-date version of EZGUI.

    TIA!
     
  36. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    Grimmy, Marty,

    Have a peek back a couple of posts and look for ones by Brady. I can't remember if he said PM or email, but if you send him your confirmation code/sales receipt he will send you a copy asap as Google Groups are having trouble downloading these files.

    Marty, the google group is listed on the email you received from the sales robot just after purchasing...
     
  37. hxx2010

    hxx2010

    Joined:
    Aug 31, 2009
    Posts:
    155
    #3 - Panels 1 (D/L) - Creating an auto-hide toolbar, and using the transition editor to animate

    I need the source code above, this tutorial
    I still can not let it touch the unity iphone way under the control of the corresponding
    I have it in my project file, email you
     
  38. marty

    marty

    Joined:
    Apr 27, 2005
    Posts:
    1,170
    Thanks, Little Angle.

    Now, just have to wait for Brady to let me in.

    Ah, sweet demos ... finally.
     
  39. Brady

    Brady

    Joined:
    Sep 25, 2008
    Posts:
    2,474
    Thanks, Little Angel, it looks like everyone's pretty much taken care of so far. Please let me know if not.


    E-mail me privately with your order reference number and I'll send you the latest beta which does work with Unity 3 b3 (and though I haven't tested it yet, it should work with beta 4 as well). Thanks!
     
  40. marty

    marty

    Joined:
    Apr 27, 2005
    Posts:
    1,170
    Okay, I'm in the Google group, but the beta 9 file link is dead and I don't see any demos.

    Are there demos anywhere - other than the aptly-named "Simple Demo" that comes with 1.0.1 and the video "demos" on the A&B website?

    Is there a new beta 10 or RC 1.1 forthcoming?
     
  41. marty

    marty

    Joined:
    Apr 27, 2005
    Posts:
    1,170
    Nevermind, just got them direct from Brady!

    Thanks, all - and Brady!
     
  42. Kawe

    Kawe

    Joined:
    Dec 3, 2009
    Posts:
    132
    Ya, I'm hoping for a 1.1 soon too :)

    Just started on a new project...

    Is it easy to upgrade from 1.0 to 1.1?
     
  43. Quallity

    Quallity

    Joined:
    Jul 16, 2010
    Posts:
    20
    I've got some questions:
    1. Is the possible to click on buttons and then panels change when click on tabs? and not go back/forward +1 / -1 like wizards, I want it to go to the scene it was clicked.

    2.How can I show a drop-down menu? do I need to create it manually without using EZGUI and just attaching the created drop-down menu to the desired location and as a child of the panel?

    3.I've a toggle buttons, and I need the hovering to work too, what should I replace it with? pure coding?

    That's it for now.
     
  44. marty

    marty

    Joined:
    Apr 27, 2005
    Posts:
    1,170
    Hey, Brady, et al.

    What's the status of EZGUI in Unity 3?

    And how about Android builds - any problems there?
     
  45. Brady

    Brady

    Joined:
    Sep 25, 2008
    Posts:
    2,474
    1. Yes. A UIBtnChangePanel can be used as in the second panel tutorial video to go directly to a specific panel. And you can do tabs specifically with the UIPanelTab control. It works like a UIBtnChangePanel, except that it has a toggle-able appearance so that the tab that is currently selected looks one way, while the non-selected tabs all look a different way. When another tab is clicked, all the other tabs go to their "unselected" appearance.

    2. The best way to do a drop-down selection would probably be using the UIBistateInteractivePanel. It is called "Bistate" because it has two states: showing and hidden. The "showing" state uses the BringInForward transition, and the "hidden" state uses the DismissForward transition. So you can define where it should be, etc, when showing, and where it should be when "hidden". Then when you click it, it will automatically come into view, and can then automatically dismiss itself either when one of its child controls is clicked, or when you click outside of it - just like a "normal" pop-up menu.

    3. This is more complicated than a regular button because a UIStateToggleBtn can have any number of states, and to make it "hoverable" you will need an additional "over" appearance for each of these states. Perhaps the easiest way just to get a "hover" appearance for the button would be to modify the UIStateToggleBtn's OnInput() method to check for a mouse over event, and then when one occurs, tell a sprite layer to show its "Over" state. In other words, create a sprite using SM2 that has an animation called "Over", add it to the "layers" array of the control in the inspector. Then when a mouse over event occurs in OnInput(), call SetState("Over") on the layer element.

    For more info on layers, see the EZ GUI docs.


    @marty

    The 1.1 b9 build should run in Unity 3 just fine. I just recently received my Nexus One and haven't had a chance to do a whole lot of testing for Android yet. I think a couple of #ifs need to be added, but that should be all as b9 uses the newer platform-agnostic touch API calls.
     
  46. marty

    marty

    Joined:
    Apr 27, 2005
    Posts:
    1,170
    Awesome, Brady!

    BTW, is EZGUI usable for dynamic GUI items like numeric scores, progress bars, speedometers or are those things better done with SM2?
     
  47. Brady

    Brady

    Joined:
    Sep 25, 2008
    Posts:
    2,474
    It's definitely good for progress bars as it has a native progress bar object (also good for health bars). With native text support (coming soon), it will be great for scores as well (a TextMesh works well too, but EZ GUI's text will be more feature-rich).

    There isn't currently a control that lends itself to being a speedometer (assuming you mean a rotating needle), though in the next release I have planned a "progress arc" control which lets you display something that travels in an arc (or fills an arc shape) that works much like a progress bar (holds a value from 0-1). And that should be perfect for that once that is ready.
     
  48. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    FWIW, this is the base of a speedometer I used in SpriteUI which was based on SM1. Feel free to use it if it helps.

    Code (csharp):
    1. //  Update Velocity called from ShipController.js
    2. function UpdateVelocity (currentVelocity : Vector3) {
    3.     var rawVelocityMagnitude = currentVelocity.magnitude * 50;
    4.     if (currentVelocity.magnitude > 0.01) {
    5.         var currentAngle : float = -(Mathf.Clamp(rawVelocityMagnitude, 0, 280));
    6.         var velocityFGTransform : Transform = velocityFG.client.transform;
    7.         velocityFGTransform.rotation = Quaternion.Euler (0,0,currentAngle);
    8.  
    9.         velocityFG.Transform();
    10.     }
    11.     //MoreCode
    12. }
     
  49. Quallity

    Quallity

    Joined:
    Jul 16, 2010
    Posts:
    20
    Thanks Brady for the detailed reply, I'll go explore some more of its features :p
     
  50. marty

    marty

    Joined:
    Apr 27, 2005
    Posts:
    1,170
    Native dynamic text? Wow!

    Is that a 1.1 feature?