Unity Community


Page 6 of 108 FirstFirst ... 456781656106 ... LastLast
Results 101 to 120 of 2156

  1. Posts
    6,314
    @hippo, but of course there is text size support. It's a requirement for the text alignment feature coming in the future I believe the method is sizeForText if I'm not mistaken.

  2. Super Moderator
    Location
    Great Britain
    Posts
    9,661
    Wow, you must be some kind of mad genius thinking of that too. I only posted half hoping it would be in there. What I must really bother you for is a list of commands and their parameters. That would really speed things up this end Pretty please that you might throw a quick page up?
    Currently working with Sony on our new
    PS4 and Vita game in Unity!

    This post is not representative of Simian Squared Ltd


  3. Posts
    6,314
    @hippo, nothing genius about this one unfortunately. I needed to right align some text and that required the width so the method was born!


    A very basic (and not complete) API reference is available here: http://prime31.com/unity/docs/#uiToolkitDoc

    If you use C# and MonoDevelop you can use code complete to get a full list of available methods. Over time we will fill in the method summaries which MonoDevelop displays in the code complete window. Some stuff is in there but a lot ins't yet.


  4. Location
    Brazil
    Posts
    87
    Hi Prime31 Now I really don't have any excuses for using your GUI system it works perfect on my nexus one (The only scene that did not worked was the joystick)

    Thanks again for the great tool!


  5. Posts
    6,314
    The joystick demo scene hasn't been given the proper relative positioning support to work on all platforms. It is currently iOS non-retina only but it shows all the tools you need to make it for any platform.

  6. Super Moderator
    Location
    Great Britain
    Posts
    9,661
    I found some oddities in text alignment on mac unity editor and pc unity editor - but that might just be me. I will investigate further... namely the mac version was whole newline too high. What might cause that do you think?

    Thanks for the api docs! I am happy as a pig in muck. It is still quite baffling you did not charge for this
    Currently working with Sony on our new
    PS4 and Vita game in Unity!

    This post is not representative of Simian Squared Ltd


  7. Posts
    6,314
    @hippo, I can't imagine there would be a difference between the Mac and Win newline. It comes from the exported fnt config.

    There is no charge for UIToolkit so that Unity devs have no excuse why their menus and HUDs are not as polished as their games. Not to mention with the advent of the Asset Store there isn't much sharing going on anymore. Everyone dumps their wares in the AS instead of sharing. Sometimes a freebie is good to get the new users pumped and motivated about using Unity.

  8. Super Moderator
    Location
    Great Britain
    Posts
    9,661
    You have succeeded on my end at least. It has also got me thinking "what could I contribute" as well.
    Currently working with Sony on our new
    PS4 and Vita game in Unity!

    This post is not representative of Simian Squared Ltd


  9. Location
    Melbourne, Australia
    Posts
    696
    Just to be picky - why the lower case method names?


  10. Posts
    6,314
    @duke, just to be different than the Microsoft code guidelines mainly Not to get into a discussion about the benefits of different code guidelines or any of that off topicness over the years programming many, many different languages camel case method names and instance variables with capital lettered class names was always more clear but YMMV.


  11. Posts
    16
    Just updated from the first version to the latest. The process for making buttons relative to the edges is awesome now.

    Just one thought though - all the position methods have parameters which are ( y-axis , x-axis ) for their adjustment. It's a bit confusing. Might be better to be x-axis, y-axis ordering like Vector2's. Though you would have to reorder the methods to be positionFromRightTop rather than positionFromTopRight which doesn't sound so natural I guess...


  12. Posts
    6,314
    @Tainted, it was a tough call but sounded more natural to have top/bottom first due to the way we speak (English at least).


  13. Posts
    16
    Yeah fair enough, just one of those situations where you gotta make a call I guess.

    Just noticed the UIToggleButton isn't showing it's highlighted state. It's missing the

    Code:  
    1. this.highlightedUVframe = highlightedUVframe;

    from the constructor and the

    OnTouchBegan method with
    Code:  
    1. highlighted = true
    .


    I also started hacking together a discrete slider (one that goes from min to max in increments of 1). As I was doing that I noticed that the UISlider goes from 0 to 1, but the knob doesn't move for small values close to 0 and 1. You've got the position going from:

    Code:  
    1. float xPos = position.x + normalizedKnobValue * width;

    while if you do this:

    Code:  
    1. float xPos = position.x + (_sliderKnob.height/2) + (normalizedKnobValue * (width - _sliderKnob.height));

    basically interpolating between the knob min max rather than the slider's min max, the knob will move for every value. It's not a big issue, just trying to make the awesome code even better


  14. Posts
    6,314
    Good finds. I'll be looking forward to your patch or pull request


  15. Posts
    16
    haha will do once I come out from under my TortoiseSVN shell and learn how to do a GIT pull


  16. Posts
    6,314
    There is a tortoiseGit if I'm not mistaken. Works just like the SVN one.


  17. Posts
    16
    Downloaded Git + Gitti (I'm on a mac atm). Made the changes for the toggle button but now I can't push them as a patch. Argh, I think either Gitti doesn't support patches or I've cloned the repo instead of pulled it. Since the repo is read-only I should be creating a patch which is committed and then accepted on your end right?


  18. Posts
    6,314
    @Tainted, so far, you get an A for effort! Well done! Here are the steps to take to pull it off:

    - Click the fork button to get your own fork of the repo:

    - Make the changes in your local repo and check them in (unlike SVN, checking in with Git doesn't push the changes to the server)
    - Push the changes to the Github server
    - Make a pull request on the UIToolkit Github page

    Once you get used to Git SVN becomes a painful chore to use. Might I recommend the wonderful Gitbox (has a free version) or the number one Git app Tower (paid app)


    Edit: I just pushed the fix for the UIToggleButton. I'm not so sure the slider positioning is accurate though. You are taking into account the sliderKnobs height which shouldn't have anything to do with the x-position of the slider knob. The knob is basically just a fraud (just a on the slider. Touching the track is what really matters. Like this: http://markup.io/v/9kpgvd65sz76


  19. Posts
    16
    @Prime31 Ahhhhhh. Enlightenment! Ok I've set it all up. I see you've already made the changes to the toggle. I'll be sure to check in any more bugs I find. Cheers


  20. Posts
    104

    How do I update a Score Display using UIToolkit?

    I converted the sample code to JS, and get a nice "SCORE 123" display. But I don't know how to update the display during gameplay with the ever increasing score. I got only a few months of coding experience, and only JS.


    Code:  
    1. class RolfScoreDisplay extends MonoBehaviour {
    2. private  var text1 : UITextInstance;
    3. function Start () : void {
    4. var text = UIText( "prototype", "prototype.png" );
    5. var score = 123;
    6. var x = UIRelative.xPercentFrom( UIxAnchor.Left, 0.07,0 );
    7. var y = UIRelative.yPercentFrom( UIyAnchor.Top, 0.08,0 );
    8. text1 = text.addTextInstance( "SCORE "+score, x, y , 1f,1,Color.yellow );
    9. }
    10. }

Page 6 of 108 FirstFirst ... 456781656106 ... 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
  •