Search Unity

NGUI (Next-Gen UI) -- demo final feedback request

Discussion in 'Assets and Asset Store' started by ArenMook, Dec 8, 2011.

Thread Status:
Not open for further replies.
  1. netics

    netics

    Joined:
    Aug 23, 2011
    Posts:
    102
    I am using NGUI for drawing HP bar of Units in RTS game.

    Unit moves everyframe. so hp-bar(UISlider) should moves everyframe.

    But there is a problem that position of hp bar has one frame delay.

    Unit sets hp-bar position in Update() call.

    and it seems that NGUI determine final UI position in LateUpdate() call.

    But delay happens....... hmmmm....

    Where should I change my code? or modify NGUI?
     
  2. Asse83

    Asse83

    Joined:
    Aug 1, 2009
    Posts:
    169
    Ok, but take, for example, your scroll view from example 12. The wooden frame is there and the griditem with text, the background and a placeholder for the icon is designed by an artist and saved as a prefab. Now the icon on these griditems has to be streamed and is a seperate texture und should be positioned as a UIWidget onto the placeholder. As far as I understand this won't be possible with several panels since it cannot be connected to the griditem. Am I wrong? :-/
     
  3. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
    @yuewah: I've adjusted it on my end.

    @netics: Tweak the order of script execution. The position-determining script should be executed before UIPanel.

    @Asse: You can do all of that with 1 panel if you move whatever goes on top of the dynamic icons into another atlas. Then you will just have one panel pulling from 2 atlases and the dynamic icons. As far as the Z is concerned, all background items should be on one Z (0), then you have your icons (-1), then your overlay (-2). As long as all of your items keep this structure, you won't have any issues.
     
  4. Asse83

    Asse83

    Joined:
    Aug 1, 2009
    Posts:
    169
    You know what, you're right ;) Thanks man!
     
  5. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
    1.88
    - NEW: Added an option to the tweener to use steeper pow(2) curves for ease in/out tweens.
    - NEW: You can now specify the movement threshold that will be used to determine whether button presses are eligible for clicks on UICamera.
    - NEW: You can now specify an input field to be password-based, and it will only hide the text once you start typing.
    - FIX: UIButtonTween can now disable objects properly after a toggle.
    - FIX: UISavedOption can now save the state of a single checkbox in addition to a group of checkboxes.
    - FIX: Localization now handles duplicate key entries silently.
    - FIX: Widgets not using a texture will now have gizmos.
     
  6. Asse83

    Asse83

    Joined:
    Aug 1, 2009
    Posts:
    169
    Using a UIPanel with a clipping mode enabled and the Depth Pass on, gives shaded outlines of the content outside the clipping area (can be easily tested in e.g. example 12). Is there a way to avoid this?
     
  7. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
    Don't use depth pass with clipping.
     
  8. rockysam888

    rockysam888

    Joined:
    Jul 28, 2009
    Posts:
    650
    I tried to follow basic tutorial from ngui website.
    After adding the slider, I get the following message in console. Why?
    When I click background, foreground and thrumb under object "slider", I even got more message:
     
    Last edited: Mar 28, 2012
  9. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
  10. rockysam888

    rockysam888

    Joined:
    Jul 28, 2009
    Posts:
    650
    Hi I updated to newest version v1.84. First three errors are removed.
    The last one remains. No information about this in FAQ.
    Any idea?
     
  11. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
    It's not an error. It's just a message from Unity, and is harmless.
     
  12. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
    Also btw, the latest version is 1.88, not 1.84.
     
  13. holyjewsus

    holyjewsus

    Joined:
    Mar 7, 2011
    Posts:
    624
    Hey Arenmook, I've got a strange problem, I've got 3 sliders that are sitting on an game object with drag object.cs on it. The sliders seem to work great in the scene view when it's docked into the unity window. When I maximize the window or make a build, only one slider reliably moves or receives hover events that make the thumbs grow and change color. Any idea what the problems could be?

    If I add a new slider it doesn't seem to happens so it must be something I have done.
    I've changed the scale of the slider sprites and the full parameter to make them smaller.

    Any advice for the proper way to resize the sliders.

    sorry, my error, I had colliders on the background and foreground somehow that were getting in the way.
     
    Last edited: Mar 29, 2012
  14. netics

    netics

    Joined:
    Aug 23, 2011
    Posts:
    102
    bug report?

    If UISlider.fullSize is changed and UISlider.rawValue is unchanged, Slider length should be modified, but it does not.
     
  15. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
    'rawValue' has been made private recently. Update, and you shouldn't be using it at all.
     
  16. netics

    netics

    Joined:
    Aug 23, 2011
    Posts:
    102
    It happens if I use 'sliderValue'.
    does it fixed in recent version?
     
  17. netics

    netics

    Joined:
    Aug 23, 2011
    Posts:
    102
    [deleted by double posting]
     
    Last edited: Mar 29, 2012
  18. rockysam888

    rockysam888

    Joined:
    Jul 28, 2009
    Posts:
    650
    NGUI feature request:
    1. Could some kind of alignment function for gui elements be added ? (eg. align label and input to bottom)
    2. Move to top or to bottom
     
  19. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
    @netics: Ah I see what you mean. The full size is one of those values I intended to be set in the editor once and not modified at run-time. I'll see what I can do about it.

    @rockysam: All widgets already have a pivot you can set. Do you mean something else?
     
  20. rockysam888

    rockysam888

    Joined:
    Jul 28, 2009
    Posts:
    650
    1.Alignment function: (similar to those of microsoft word: http://www.computergaga.com/word/2003/foundation/objects/arrange_objects.html
    Eg. Before alignment:

    Selecting label and input for each line twice and pressing proper align button:

    Final result:

    With these functions, users could align objects more efficiently and accurately without trial and error.

    2.Move to top or to bottom (I should have said "Bring to Front" and "Send to back", similar to ms word :http://www.computergaga.com/word/2003/foundation/objects/arrange_objects.html)
    eg. if you create tile sprite and then button, the button is always on top of tile sprite. Fine.
    However if you create button and then tile sprite, tile sprite is always on top of button. With "Bring to back" for tile sprite, we send it to the back of button to maintain the correct order.

    Otherwise, we must delete one of them and re-create again. For many gui objects, this is inconvenient.

    Are these possible for ngui?
     
    Last edited: Mar 29, 2012
  21. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
    1. You can already do this using UITable.
    2. Why would you delete anything? Select the sprite, and push the "Back" button.
     
  22. rockysam888

    rockysam888

    Joined:
    Jul 28, 2009
    Posts:
    650
    1. I see. The basic tutorial shows placing gui objects on panel (not UITable). Are there any similar functions like "Align left" or "Align bottom" for panel?
    2. Thanks. I will try it.
     
  23. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,208
    Hi Aren - I would like this functionality too - basically, just select a bunch of items, and choose "align left" or "align top" (etc), and have the transform set so the items are aligned. Just makes it easy when you are setting up more complicated forms. There are some tools in the asset store to do this, but people report that they don't work well with ngui. Of course it can be done manually by copying and pasting the coordinates, but it's nice to have an editor function to do it.
     
  24. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
    @rockysam: The panel (and grid) reposition all of their children, aligning them. You can try it -- add a UITable to a parent object, add a bunch of children, then select the table and use the "reposition now" checkmark.

    @Jaimi: Generally for forms you would be using a UITable or a UIGrid anyway, which will take care of aligning things for you.
     
  25. kevinseligmann

    kevinseligmann

    Joined:
    Mar 23, 2011
    Posts:
    68
    Hi! I'm trying to make a GUI with DDS Textures (DXT5 to be precise), is this possible with NGUI? Unity displays them flawlessly on a GuiTexture, but i'm unable to load this texture inside my atlas.

    Any idea? Thanks!
     
  26. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
    NGUI doesn't load any textures directly. If Unity can read it, then NGUI can use it.
     
  27. kevinseligmann

    kevinseligmann

    Joined:
    Mar 23, 2011
    Posts:
    68
    The I just don't understand why my texture isn't loaded into my Atlas. I do the same process with every image I have, and each of them imports just fine.

    You say that NGUI doesn't load directly, but sure it creates a new texture compositing all the others to make an Atlas Texture right? Could it be something with that?
     
  28. rockysam888

    rockysam888

    Joined:
    Jul 28, 2009
    Posts:
    650
    Hi ArenMook ,

    Could you tell me where could I add UITable or UIGrid visually?
    I can't find them in the template of widge tool.
     
  29. col000r

    col000r

    Joined:
    Mar 27, 2008
    Posts:
    699
    Hi Aren - spent the morning looking into NGUI and I am impressed!

    I also ran into a little problem in my test-scene: It's all one Camera, I have a drag-mouse-orbit script to move the cam - now if I point at one of the panels and then drag upwards to look at it from below something weird happens - jittering, camera seems to jump between 2 positions. Please check it out in the web player here: http://blackish.at/stuff/blogimages/NGUI/nguiTest2.html

    It's not the drag-mouse-orbit script, that works as expected if I disable all GUI. I think it must have something to do with the colliders on the UIImageButtons. If I move the camera to the problematic position and disable the collider of the button in front, the jittering stops. Any ideas how to solve this? (Thanks a lot in advance)
     
  30. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
    @kevin: NGUI creates a new texture, yes. It's saved as a PNG, however. Are you following the video tutorial on how to create an atlas?

    @rockysam: Just drag drop the script onto the object.
     
  31. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
    @col000r: do you have a script that raycasts from the center of the asteroid outward, and if something is hit, it moves the camera closer? Look at that one, because it's hitting the button colliders, and it shouldn't use the UI layer in its raycasts.
     
  32. kevinseligmann

    kevinseligmann

    Joined:
    Mar 23, 2011
    Posts:
    68
    Yes, I'm following it step by step. I already used the Atlas Maker several times, and this is the first time it presents an issue. Could you try to load a dds texture into the Atlas Maker? I'll attach my texture here.

    Thanks in advanced, really.

    View attachment $bienvenidos_dds.rar
     
  33. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
    Thanks, the attachment helped. Looks like Unity fails to recognize it as a valid texture for some reason. It's not getting imported via the TextureImporter, which is why NGUI can't use it.
     
  34. rockysam888

    rockysam888

    Joined:
    Jul 28, 2009
    Posts:
    650
    @ArenMook: Are there any tutorial for using UITable or UIGrid? I only use ngui 3 days only.
    It would be more convenient if there is something like "align left" without adding any unnessary table or grid ... :)
     
  35. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
    Last edited: Mar 29, 2012
  36. col000r

    col000r

    Joined:
    Mar 27, 2008
    Posts:
    699
    oh, right! works like a charm now, thanks!
     
  37. rockysam888

    rockysam888

    Joined:
    Jul 28, 2009
    Posts:
    650
    Thank you for info.
     
  38. col000r

    col000r

    Joined:
    Mar 27, 2008
    Posts:
    699
  39. col000r

    col000r

    Joined:
    Mar 27, 2008
    Posts:
    699
    deleted double post
     
    Last edited: Mar 29, 2012
  40. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
    I really like the smooth dragging of the asteroid and how the UI seems to be a part of the scene rather than just "there". Your font seems really sharp even when zoomed in. Did you use a large font texture for that?
     
  41. kevinseligmann

    kevinseligmann

    Joined:
    Mar 23, 2011
    Posts:
    68
    So there's no way to use this texture within NGUI?
     
  42. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
    Doesn't seem to be. Convert it to something other than DDS and it should work fine though. All the texture settings such as compression and such get overwritten by Unity anyway.
     
  43. kevinseligmann

    kevinseligmann

    Joined:
    Mar 23, 2011
    Posts:
    68
    Yeah, the problem is that every other texture format, including PSD, PNG and such loose quality. I need extra quality in this GUI because of images with large amounts of text, and this images get blured or unreadable. I tried changing Filter Mode, Format, and every other possible setup for my textures, but none get the requirement level I need, except DXT5 and DXT3.

    It's a shame, the quality of those formats is unbelievable.
     
  44. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
    Lose quality? When creating an atlas, NGUI forcefully changes the import settings of textures to Truecolor, which is lossless. Even if you didn't use the NGUI's atlas maker tool, you can select the texture in question, and change it from "Compressed" to "Truecolor" to remove the compression quality degradation.

    DXT5, btw... is a lossy compression algorithm. Your textures end up 1/4th of their truecolor size, and the quality degradation is very noticeable once you zoom in.
     
  45. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
    Oh and one last thing... the texture you sent me is not power-of-two. Unity force-changes textures that arent power of two to be power of two, which seriously harms the quality. If you import the texture as "GUI" with "Truecolor" this doesn't happen.
     
  46. kevinseligmann

    kevinseligmann

    Joined:
    Mar 23, 2011
    Posts:
    68
    Even changing to Truecolor my text is not readable, I will attach a screenshot for you to see. The image displayed on the GUI is a PSD file, with the settings in the right. Same settings, but with an image in PNG is just impossible to read.

    If I change the image to my DXT5 one, the quality overall is raised a lot, the text on the bottom part of the image is perfectly readable.

    $ScreenShot00031.png
     
  47. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
    Texture Type: Texture.

    Change it to GUI as I suggested.
     
  48. kevinseligmann

    kevinseligmann

    Joined:
    Mar 23, 2011
    Posts:
    68
    Didn't see that post, let me try.
     
  49. kevinseligmann

    kevinseligmann

    Joined:
    Mar 23, 2011
    Posts:
    68
    I deleted the Atlas, made it again from scratch with my PSD texture imported as GUI, Trillinear and TrueColor and the result is the EXACT same one as the screenshot I posted.
     
  50. ArenMook

    ArenMook

    Joined:
    Oct 20, 2010
    Posts:
    1,902
    What are you using to create the atlas?
     
Thread Status:
Not open for further replies.