Unity Community


Page 3 of 108 FirstFirst 123451353103 ... LastLast
Results 41 to 60 of 2156

  1. Posts
    6,314
    @leonardoaraujo, the next push will have Android support. Due to the way Android handles StreamingAssets (poorly) we may have to just make a quick switch to using TextAssets instead so that Android works out of the box. Technically, then entire UIToolkit works fine on Android except for that one small thing: reading the StreamingAssets files.


  2. Location
    Brazil
    Posts
    87
    Thanks Prime31 for the great tool I will wait for the next version with android support


  3. Posts
    6,314
    @leonardoaraujo.santos, looks like you have no more excuses to not use UIToolkit Android support was just pushed to the Github repo.

    A new experimental branch is also out in the wild that replaces the single mesh with quads for each UI element. At this point, I'm not sure what will be used going forward but it doesn't matter so much because the API will be identical.

    Quick note for anyone out there using UIToolkit: you have to rename the .json config files and .fnt files to .txt (and move them to a Resources folder) now due to Android not having a smooth StreamingAssets solution. Check the README for details.


  4. Location
    Adelaide, Australia
    Posts
    80
    First off UIToolkit is awesome. Great work Prime31.

    Quick question about making sliders hidden. When I set my slider to hidden it doesn't seem to make the slider knob hidden as well. You can test this in the kitchen sink demo by making the slider hidden immediately after creating it in Start. (Using myslider.hidden = true)

    Am I missing something here? Is there a different way to hide things if they are composed of more than one Sprite? As a quick test I just added a method to UISlider that hides itself and its knob and it all seems to work.

    On a related note, should we be wary of creating UI objects and using them straight away? I seem to recall in GUISpriteUI that some UI classes were temperamental if you did stuff to them striaght away. i.e. hiding them, setting values. Basically, once a UISprite object is created is it all good to go or is there some setup still to happen?
    Check out my Unity, C#, Game-Dev, Programming blog at Friction Point Studios
    And follow me on Twitter.


  5. Posts
    16
    @Sam, what you need to do is make the hidden attribute virtual in UISprite, then in UISlider add the following:

    Code:  
    1. public override bool hidden
    2.     {
    3.         get { return ___hidden; }
    4.         set
    5.         {
    6.             // No need to do anything if we're already in this state:
    7.             if( value == ___hidden )
    8.                 return;
    9.  
    10.             if( value )
    11.         {
    12.                     manager.hideSprite( this );
    13.             manager.hideSprite( _sliderKnob );
    14.         }
    15.             else
    16.         {
    17.                     manager.showSprite( this );
    18.             manager.showSprite( _sliderKnob );
    19.         }
    20.         }
    21.     }


  6. Location
    Adelaide, Australia
    Posts
    80
    @TaintedLemon Thanks for the code. That's what I was thinking about doing, but just wasn't sure if there was perhaps some other, in built, way to do it. Like a static or helper method somewhere that I was missing.

    When I've finished the insane amount of work I've got on at the moment, I might have to try and get git access from @prime31 and jump on the improvements bandwagon. Adding an Allignment option to UIProgressBar would be a good place to start maybe.
    Check out my Unity, C#, Game-Dev, Programming blog at Friction Point Studios
    And follow me on Twitter.


  7. Posts
    6,314
    @Sam and @Tainted, I just pushed a fix for this that pretty much does what TaintedLemon mentioned. I also wired it up in the kitchenSink demo scene to the toggle button for demonstration purposes.


  8. Posts
    105
    can you deliver as a .unity package please?


  9. Posts
    6,314
    @shabazzster, there is a unitypackage available in the downloads on Github

    The latest push also received much cleaner relative positioning support. See the kitchen sink demo for example code.


  10. Location
    Chicago, IL
    Posts
    742
    Can I use this for windows and os x too? Keep it up Prime31
    Shooter's Alley iOS - Thread


  11. Posts
    6,314
    @mehware, you can but it will require a minor change. There is mouse support for the editor but it is disabled for non-editor (when running on a device). I'll redefine the defines in the next update so that mouse support stays active on web, osx and windows builds.


  12. Posts
    6,314
    Just for you mehware I pushed a new build with support for web and standalone.


  13. Location
    Zürich
    Posts
    44
    Hello Mike

    Thanks for the work here, I was very happy about some of your plugins for our last app and it's nice to see you coming up with new helpfull stuff.
    In the App we created we have quite a lot of complex Guistuff. check out the Video on the other Post. here

    As you can see, we have some dragable lists, and quite a lot of text-stuff. A problem I had was standard buttons are completely useless the most time, because when you drag them they need to get deactivated.
    Dragable text needs textlength calculations, to know how far you can drag them.
    A dragable List also needs something like a Masked Area, where the list is in.

    So do you have solutions for this kind of needs?
    - Accessing buttonstates, so I can activate/ deactivate on touch Down touch Up touch Move and so on.
    - Calculations of text width/height with a cerain font.
    - A Kind of Mask thing, like GUI.BeginGroup(Rect); GUI.EndGroup() to crop stuff.
    - Some adaption of the GUI.Color maybe?
    - Scaling a button with round corners, some adaption of the guistyle.style.border thing?

    What I enjoy to see is the highlightedTouchOffsets, had some similar problems with a small back and home button to solve
    The second thing that it's nice is to be free of the OnGui function, it just kills your bwain because you can not really use classes to create complex Guistuff. productlist was just *grrr i want to shoot someone*


  14. Posts
    6,314
    @gamma, for the kind of stuff you had in that app I would have used UIKit and gone native for sure. So much of that is already built into iOS. UIToolkit doesn't aim to solve that problem. It is more for menus and in-game HUDs. The text support is still basic (you can get the height/width for the string and scale) but it doesn't yet have alignment. Color support is in. You can tint any object or string. There is no 9-slice component yet nor is there masking. The great joy of UIToolkit is that it is open source so you can make whatever you need then give back to the community the source code you made!


  15. Posts
    6,314
    Just uploaded an intro video tutorial to YouTube on how to setup UIToolkit and make a relatively laid out UI

    http://youtu.be/WeV1zbMpm5k

  16. Super Moderator
    Location
    Great Britain
    Posts
    9,661
    Hi Prime,

    I took a little look at this and noticed some glaring issues.

    1. the sprite borders aren't smooth, they have white halos and jaggy bits. Is this just a result of the texture packer as it looks quite bad.

    2. the shader used for the ui contains alpha test. Alpha test is one of the slowest things you can do on iOS, and I was wondering if you would consider removing it for a simpler shader?
    Currently working with Sony on our new
    PS4 and Vita game in Unity!

    This post is not representative of Simian Squared Ltd


  17. Posts
    6,314
    1. The textures were hacked together from Google image searches so they have some cruft. Feel free to provide some nice images for the demo scene!

    2. Feel free to comment out the alpha test if you don't need it or provide a stripped down shader (there is already a second without vertex alphas). It's open source so you can make it whatever you want and pass your changes back to the rest of the users so they can all benefit!

  18. Super Moderator
    Location
    Great Britain
    Posts
    9,661
    Yes brilliant, I just wanted to run those by you in case people miss those little details. I think you have found someone willing to save up and purchase -all- your plugins. It beats me why there isn't a bulk purchase option!
    Currently working with Sony on our new
    PS4 and Vita game in Unity!

    This post is not representative of Simian Squared Ltd

  19. Super Moderator
    Location
    Great Britain
    Posts
    9,661
    Ugh problems.

    1. I made a GameObject called UILayer, and a layer called UILayer, as in the video.
    2. I added the script called UI, to UILayer.
    3. I made a new material called UIMaterial, and assigned it to the UI script slot for Material.
    4. I gave the material your UIToolkit/Alpha Enabled (Default) material.

    Without any extra changes or anything, I hit run and get these errors:
    UI texture is being autoloaded and it doesnt exist:
    UnityEngine.Debug:Log(Object)
    UISpriteManager:Awake() (at Assets/Plugins/UIToolkit/BaseElements/UISpriteManager.cs:111)
    UI:Awake() (at Assets/Plugins/UIToolkit/UI.cs:37)
    and...
    NullReferenceException
    UnityEngine.Texture.get_width () (at C:/BuildAgent/work/6bc5f79e0a4296d6/Runtime/ExportGenerated/Editor/Graphics.cs:900)
    UISpriteManager.Awake () (at Assets/Plugins/UIToolkit/BaseElements/UISpriteManager.cs:116)
    UI.Awake () (at Assets/Plugins/UIToolkit/UI.cs:37)
    I am only copying the process of the demo scene for text. I just want to display a simple FPS counter. Any ideas? (using javascript and have not yet got past above problems).

    I have a prepared .txt hiero font file and png, all ready to load in, but I can't get that far yet since it will not run without crashing even if I do have code waiting to be used for text. I must be missing something obvious, or perhaps it will not work without a dummy empty json + texture (even though I only want text?)...
    Last edited by hippocoder; 05-06-2011 at 09:18 PM.
    Currently working with Sony on our new
    PS4 and Vita game in Unity!

    This post is not representative of Simian Squared Ltd


  20. Posts
    6,314
    @hippo, I didn't get a chance to make the font video yet but it's pretty simple. You always need to make a TexturePacker atlas. That is what you are missing. Stick the exported png from Hiero (sometimes it exports flipped so flip it back of it did) into a TexturePacker atlas just like the button images were added in the video. Then you can export the .json file (renaming to .txt) and your actual texture atlas. Be sure to stick it's name in the inspector slot like in the video.


    The idea behind it is that you put all you UI images including your font bitmaps in the same atlas so they all get shared in the same draw call. If that doesn't make sense let me know. I am hoping to get the font video up tomorrow but I've got a big item on the UIToolkit todo list to finish first.

Page 3 of 108 FirstFirst 123451353103 ... LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •