Unity Community |

any ideas? really struggling here with something that i'm sure should be simple if I only had some guidance...If UIToolkit doesn't let me do this, is there another iOS/Android-friendly component that will let me create a UI button with dynamic text?
oops...forgot to include the original post. can anyone help out here? not sure how to set the level for a button show I can show dynamic, overlaid text (this is for a kind of quiz game where answer choices will change)Can anyone provide guidance on specifying depth for UIButton creating using Prime31's UIToolkit? I have a series of buttons with changing text (from the user's point of view, anyway), and it seems the best way to accomplish this is to create UIButton and set its depth lower than UIText (any other suggestions on setting text for a button are welcome). Problem is, I can't figure out what do for the first parameter in the overloaded method for UIButton.create that allows setting the depth: UIButton.create(UIToolkit manager, string filename, string Highlightedfilename, int xPos, int yPos, int depth).
What the heck do I do for that first "UIToolkit manager" parameter? As I said, any suggestions on other ways to assign text to buttons are welcome (this is for an educational, quiz-type game).
Also...I've tried declaring "public UIToolkit buttonToolkit;" (as illustrated in the example at https://github.com/prime31/UIToolkit...Manager.cs#L15) and then using that in my UIButton instantiation (var btn150 = UIButton.create(buttonToolkit, "150.png", "150.png", 0, 0, 5), but this just results in an "Object reference not set to an instance of an object" error. Any ideas?
Thanks!
OK, figured this out...MultipleAtlasManager example got me where I needed to go.
I have added two sprites to a toolkit. One is an arrow and the other is an image. Here is what I have:
Code:
if (_hintMoveLayout == null) { _hintMoveLayout = new UIAbsoluteLayout(); UISprite hintMove = _toolkit.addSprite("hint_move.png", 0, 0, 0); hintMove.pixelsFromBottomLeft(240, 180); UISprite hintArrow = _toolkit.addSprite("hint_arrow.png", 0, 0, 0); hintArrow.pixelsFromBottomLeft(150, 210); _hintMoveLayout.addChild(hintMove, hintArrow); }
I thought that animating the layout would animate properly, but it doesn't. How can I change the origins of the hintMove and hintArrow sprites so that they popout from center?
Cheers
Just to clarify, by popout from center I mean center of both sprites, not independent of each sprite but grouped.
Can I use it to build UI for desktop app?
How can I download it? GitHub is not really "user friendly"...
@Neverbe I usually download the master branch https://github.com/prime31/UIToolkit/zipball/master
I would like to dynamically create a UIToolkit at the end of the level. Here is the code that I am trying but it fails to create the UIToolkit component:
Code:
using UnityEngine; using System.Collections; // Material for bubble UI public Material bubbleMaterial; private UIToolkit _toolkit; void InitToolkit() { if (_toolkit != null) return; // Create new UI toolkit for bubble interface _toolkit = bubbleToolkit.AddComponent<UIToolkit>(); _toolkit.material = bubbleMaterial; _toolkit.texturePackerConfigName = "Bubble"; _toolkit.layer = 0; } public void DisplayWellDone() { InitToolkit(); } public void DisplayWhoops() { InitToolkit(); UISprite bubble = _toolkit.addSprite("whoops_bubble.png", 0, 0); bubble.centerize(); bubble.positionCenter(); } }
Any ideas?
Hi!
I am from asia and I try to implement cjk font in uitoolkit.
I made NanumGothicExtraBold resource as in http://forum.unity3d.com/threads/879...t-s-free/page4
But following error occurred when it runs.
IndexOutOfRangeException: Array index is out of range.
UIText.loadConfigfile (System.String filename) (at Assets/Plugins/UIToolkit/UIElements/UIText.cs:135)
UIText..ctor (.UIToolkit manager, System.String fontFilename, System.String textureFilename) (at Assets/Plugins/UIToolkit/UIElements/UIText.cs:86)
UIText..ctor (System.String fontFilename, System.String textureFilename)
OutlineTextManager.Start () (at Assets/_Test/OutlineTextManager.cs:22)
Doesn't it support unicode?
Attached file is what I made for cjk font in texturepacker.
Help me?
Thank you,
Regards,
Adam.
Last edited by AdamWorld; 04-03-2012 at 09:09 AM.
Hey guys, Can someone take a look at the Joystick code? I think it's faulty.
HI!
I made BMFont(4096*4096) for asian font.
But when I run it in Android, font doesn't work correctly.
when BMFont size is 2048*2048, it works well.
But in case of only 4096*4096 texture, it works wrong.
Could you tell me what's wrong with me?
Thank you,
Adam
+1
They UIjoystick isn't working properly. On the old package download (march 2011) from Github, if you put your finger on the joystick it moves to a position to the right of your finger.
Upgraded to the latest version and I can place a nice even touch rectangle with the joystick central in that rectangle. I've had to use the whole left side of the screen for the left joystick & all the right side for the right joystick which isn't ideal and messes with other buttons.
On another note. Is there a way to position a graphic, without it being a button? UISprite?
Thanks
Any Idea of how can I work with another Atlas for iPad retina? I've UIToolkit working on iPhone and iPhone retina but now I need to add iPad retina images.
in lieu of all these different texture resolutions, do we have access to the UI camera possibly, maybe change viewport settings or something? also how would you handle something like a "panning story" like in "where's my water"...
So did you get it working?
+1
They UIjoystick isn't working properly. On the old package download (march 2011) from Github, if you put your finger on the joystick it moves to a position to the right of your finger.
Upgraded to the latest version and I can place a nice even touch rectangle with the joystick central in that rectangle. I've had to use the whole left side of the screen for the left joystick & all the right side for the right joystick which isn't ideal and messes with other buttons.
On another note. Is there a way to position a graphic, without it being a button? UISprite?
Thanks
Hi Glyphed,Could I request a video tutorial on changing fonts for use in the UItoolkit? Showing the whole process.... So now I can get as far as having it find the right file (myatlas) and i see it on the material during play....but the text is invisible or something? I can see they are spawned in the hierarchy on play but totally invisible...
Did you ever find a solution to this problem? I'm having a similar issue.
I get zero errors in the Console when I run the project in the Game view but the text won't show up.
I used the Gotham Light open type font with AngelCode's BMFont on PC (for anti-aliasing support) to create the .fnt & .png & Texture Packer to generate the JSON .txt for the texture atlas. I'm developing on Mac for iOS.
Here's a link to the project as a .unitypackage. I'm stumped.
Can someone take a look please? Thanks very much in advance.
have you tried hiero instead? i thought i've read that bmfont has some issues with uitoolkit or vice versa
Hi! prime32.
Does UIToolkit support BMFont Multiple textures?
For the fist I used 4096*4096 texture for asian font.
But in Android tab, device doesn't support 4096*4096 texture.
So I want to use multiple textures for an asian font.
Could you help me with my problem?
Thank you,
Best Regards,
Adam.
for the panning is moving the UICamera sufficient?
create a "story board" that is taller and wider then visible, start the camera at whatever the start point is (16:9 in the editor seems to be 502,-288,-10), and then just move the xy of the UICamera to pan around the story board? How do you control the size of the viewport? for example an artist creates 2880x1920 for 9 panels of 960x640, so i want the camera to pan around these 9 panels and i want it to work on all resolutions...can UIToolkit handle this?
@pweeks - Just tried Hiero, but same problem happening. Here's the .unitypackage with Hiero .fnt's & textures.
I suspect that something is getting screwed up between Hiero and the free version of Texture Packer. Since I'm getting no errors in the Console and no fonts on screen, I'm guessing somehow the JSON file is pointing to the wrong location. Not sure why and it's just a guess for now... If anyone has time, please take a look at the .unitypackage link above.