Digital ApeModerator

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?

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.

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.

Digital ApeModerator

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

@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.

@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.

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...

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:

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?

@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

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.

@falin, it looks like everything is setup perfectly. In the screenshot you show your SD json file. Is you HD one setup properly? Can you try unchecking "auto texture selection for HD" and restart your scene to confirm?

Latest version of the kit looks really good, I had tried an earlier version, and it had a bunch of problems, but now it looks really nice.

What I'd like to have is buttons like Unity GUI does - a background image with text supplied as a string. I really don't want to create a new image for every button.

From what I've gathered in the YouTube videos, that's pretty easy with a button and a text overlayed with the proper z layering. So I'll probably code it myself and contribute - unless (and that's why I'm posting) - someone else is already working on something similar?

@Tom, I haven't heard of anyone making it but feel free to dive on in. The UIText class would need a couple additions (which it needed anyway) like drawInRect or something like that to automatically add linebreaks where necessary and text alignment. The sizeForText method is already there which is the required base for all the rest of the goodies.

I think restricting it to one line, etc. would do for the moment - really just simple buttons would be great. You know, if you have "Continue", "New Game", "Options" and "Credits" it would be nice to have only 2 (on and off) images in the texture set and not 8. So yeah, getting the dimensions of the button, of the text and then aligning it properly would be the main part.

One thing I noticed playing around is just how much damage compression does to the textures. For some reason I don't yet understand, Unity GUI textures are much closer to the source. Does the spritemanager you use do anything to the textures in addition to the import compression?

True. But even at 16 bit (and a crushing 0.5 MB per 512x512 atlas) there is still visible artifacts compared to the source PNG.

Here's a comparison. The top image is a screenshot inside the editor, the bottom is pasted in from the source file. Now I do realize that 16 bit is not identical to 24 bit and that I should expect some loss - but this much? Using 24 bit means going to 1 MB per 512x512 which means 4 MB for 1024 and hoping that 1024 is enough because you can't seriously put 16 MB into your iPhone game just for the GUI atlas.

Attached Files:

@Tom, something looks fishy there with that banding. Double check your texture import settings. The UI elements are all displayed on screen pixel perfect so whatever your texture looks like compressed should be exactly what is output.

- first off, ResumeButton is being scoped to the "if" portion of the block and it does not exist anywhere else
- ResumeButton in the "else" portion doesnt exist. I don't even know how that could get by the compiler. Toss that up as yet another reason so use C#.

You need to make ResumeButton an instance variable. Setting it to null will not remove the button. All that is doing is setting the instance variable to null. You can use the removeElement method to remove the button.