Unity Community


Page 79 of 108 FirstFirst ... 2969777879808189 ... LastLast
Results 1,561 to 1,580 of 2156

  1. Posts
    10
    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?


  2. Posts
    10
    Quote Originally Posted by jscifers View Post
    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!
    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)


  3. Posts
    10
    OK, figured this out...MultipleAtlasManager example got me where I needed to go.


  4. Location
    United Kingdom
    Posts
    703
    I have added two sprites to a toolkit. One is an arrow and the other is an image. Here is what I have:

    Code:  
    1.         if (_hintMoveLayout == null) {
    2.             _hintMoveLayout = new UIAbsoluteLayout();
    3.            
    4.             UISprite hintMove = _toolkit.addSprite("hint_move.png", 0, 0, 0);
    5.             hintMove.pixelsFromBottomLeft(240, 180);
    6.            
    7.             UISprite hintArrow = _toolkit.addSprite("hint_arrow.png", 0, 0, 0);
    8.             hintArrow.pixelsFromBottomLeft(150, 210);
    9.            
    10.             _hintMoveLayout.addChild(hintMove, hintArrow);
    11.         }
    12.        
    13.         _hintMoveLayout.scaleFromTo(0.5f, Vector3.zero, Vector3.one, Easing.Linear.easeIn);

    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


  5. Location
    United Kingdom
    Posts
    703
    Just to clarify, by popout from center I mean center of both sprites, not independent of each sprite but grouped.


  6. Location
    Italy
    Posts
    34
    Can I use it to build UI for desktop app?
    How can I download it? GitHub is not really "user friendly"...


  7. Location
    United Kingdom
    Posts
    703


  8. Location
    United Kingdom
    Posts
    703
    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:  
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public class BubbleUI : MonoBehaviour {
    5.    
    6.     // Material for bubble UI
    7.     public Material bubbleMaterial;
    8.    
    9.     private UIToolkit _toolkit;
    10.    
    11.     void InitToolkit() {
    12.         if (_toolkit != null)
    13.             return;
    14.        
    15.         // Create new UI toolkit for bubble interface
    16.         GameObject bubbleToolkit = new GameObject();
    17.         bubbleToolkit.transform.parent = GameObject.Find("UI").transform;
    18.         bubbleToolkit.layer = LayerMask.NameToLayer("UI");
    19.        
    20.         _toolkit = bubbleToolkit.AddComponent<UIToolkit>();
    21.         _toolkit.material = bubbleMaterial;
    22.         _toolkit.texturePackerConfigName = "Bubble";
    23.         _toolkit.layer = 0;
    24.     }
    25.    
    26.     public void DisplayWellDone() {
    27.         InitToolkit();
    28.     }
    29.    
    30.     public void DisplayWhoops() {
    31.         InitToolkit();
    32.        
    33.         UISprite bubble = _toolkit.addSprite("whoops_bubble.png", 0, 0);
    34.         bubble.centerize();
    35.         bubble.positionCenter();
    36.         bubble.scaleFromTo(1.0f, Vector3.zero, Vector3.one, Easing.Linear.easeIn);
    37.     }
    38.    
    39. }

    Any ideas?


  9. Posts
    56

    Change Font to CJK Font Doesn't Work.

    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.
    Attached Files
    Last edited by AdamWorld; 04-03-2012 at 09:09 AM.


  10. Posts
    8
    Hey guys, Can someone take a look at the Joystick code? I think it's faulty.


  11. Posts
    56
    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?

    Name:  SC20120405-005312.jpg
Views: 682
Size:  112.9 KB

    Thank you,
    Adam


  12. Location
    United Kingdom
    Posts
    170
    Quote Originally Posted by 10001110101 View Post
    Hey guys, Can someone take a look at the Joystick code? I think it's faulty.
    +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


  13. Location
    Spain
    Posts
    172
    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.


  14. Location
    Nederland, CO
    Posts
    87
    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"...


  15. Posts
    8
    So did you get it working?

    Quote Originally Posted by gunga View Post
    +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


  16. Posts
    8

    .fnt / texture atlas issue - no error msg from UIToolkit / UIText but no text either

    Quote Originally Posted by Glyphed View Post
    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...
    Hi Glyphed,

    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.


  17. Location
    Nederland, CO
    Posts
    87
    have you tried hiero instead? i thought i've read that bmfont has some issues with uitoolkit or vice versa


  18. Posts
    56
    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.

    Name:  SC20120405-005312.jpg
Views: 542
Size:  112.9 KB
    So I want to use multiple textures for an asian font.

    Could you help me with my problem?

    Thank you,
    Best Regards,
    Adam.


  19. Location
    Nederland, CO
    Posts
    87
    Quote Originally Posted by pweeks View Post
    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"...
    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?


  20. Posts
    8
    Quote Originally Posted by pweeks View Post
    have you tried hiero instead? i thought i've read that bmfont has some issues with uitoolkit or vice versa
    @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.

Page 79 of 108 FirstFirst ... 2969777879808189 ... 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
  •