Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Prime31 UIToolkit Multi Resolution GUI Solution Ready for Use...and it's free

Discussion in 'iOS and tvOS' started by prime31, May 3, 2011.

  1. AtomicChimp

    AtomicChimp

    Joined:
    Aug 9, 2011
    Posts:
    47
    @lagidigu3ll I only create games for mobile and I always add the entire UIToolkit file into my project. The only files that I delete from the UIToolkit are those in the demo folder. If you delete the demo folder, along with the demo assets, you should be able to get rid of most of the memory load that is concerning you. You need all of the other scripts for the full UI functionality. Before deleting the demo folder, I highly recommend taking a look at the demo scenes and scripts to get a feel for how to utilize the functionality of the UIToolkit. I keep an empty Unity project on my computer that only contains the full UIToolkit so that I can open it up to check out the demo scenes and test new functionality when needed. I hope this helps to get you started. After checking out the demo scripts, if you have other questions regarding basic setup, there are a lot of posts on this forum for helping with that.
     
  2. habitoti

    habitoti

    Joined:
    Feb 28, 2013
    Posts:
    141
    Hi,

    I played around a bit by now with UIToolkit, and I think it's amazing. I started a (by now just small) series of blogs on UIToolkit topics where I did some experiments and wanted to document the outcomes, plus maybe close step by step some of the documentation gaps by providing some samples or tips and tricks.
    If you are interested to sneak peek into the first results, you're welcome.
    I will definitely proceed to share more stuff here.

    Regards, habitoti
     
  3. trooper

    trooper

    Joined:
    Aug 21, 2009
    Posts:
    746
    It's an awesome base for UI, very simple and easy to add new stuff.
     
  4. JuiceReis

    JuiceReis

    Joined:
    May 28, 2013
    Posts:
    29
    How can i hide the UItoolkit buttons for a takescreenshot?
    I've tried creating objectname.hidden = hidingbuttons

    then in my Coroutine I have
    hidingbuttons = true;
    //code....
    hidingbuttons = false;

    But it says its in a none static member.

    Any suggestions on how to hide all the UIToolkit buttons for the length of a method or seconds?
    Could this be done through hiding the layer ?
     
  5. JuiceReis

    JuiceReis

    Joined:
    May 28, 2013
    Posts:
    29
    Sorry to post again -
    How would I go about creating an instance?
    As I need to assign 2 UIButtons to an (animation and screenshot) Coroutine.

    I can get the animation and screenshot working with one button, but when I try adding the other to the coroutine it says

    I know I need to state infobutton in the other button via a variable/string? I'm just not sure the correct way to write it.

    The name 'infobutton' does not exist in the current context
    Regards.




     
    Last edited: Jul 23, 2013
  6. rich2701

    rich2701

    Joined:
    Mar 24, 2013
    Posts:
    6
    @trooper

    Hi trooper,

    Great work with the UISlice9 implementation, very useful. I'm having an issue using UISlice9.positionTo animations where the touch region doesn't move with the sprite on screen, have you come across this problem?

    Cheers,
    Rich
     
  7. rich2701

    rich2701

    Joined:
    Mar 24, 2013
    Posts:
    6
    If anyone else comes across the same problem it was because touchFrameIsDirty was never being set to true. Within the UISlice9 override of updateTransform() add the line:
    touchFrameIsDirty = true;

    Rich
     
  8. kranthi-G

    kranthi-G

    Joined:
    Jun 5, 2013
    Posts:
    1
    Hello there,

    I got a problem with guiToolKit classes when I tried to import other scenes into my project where my gui page developed with guiToolKit existing.
    Here the error message is
    "error CS1502: The best overloaded method match for `UnityEngine.Vector3.Vector3(float, float, float)' has some invalid arguments".

    Thanks in advance,
    Kranthi.G
     
  9. jamesar

    jamesar

    Joined:
    May 21, 2013
    Posts:
    9
    Hey Prime31,

    After rebuilding my project this afternoon without making any changes to the UIToolkit framework, I received several errors that I cannot seem to work through. Some help would be greatly appreciated if you can figure out what might be going on. In addition, I have pulled the latest version of UIToolkit from git to see if that changed anything but the errors still persisted and are as follows:

    "Assets/Plugins/UIToolkit/BaseElements/UISpriteManager.cs(121,46): error CS1061: Type `string' does not contain a definition for `hashtableFromJson' and no extension method `hashtableFromJson' of type `string' could be found (are you missing a using directive or an assembly reference?)"

    "Assets/Plugins/UIToolkit/BaseElements/UISpriteManager.cs(122,43): error CS0021: Cannot apply indexing with [] to an expression of type `object'"

    "Assets/Plugins/UIToolkit/BaseElements/UISpriteManager.cs(124,17): error CS1579: foreach statement cannot operate on variables of type `object' because it does not contain a definition for `GetEnumerator' or is not accessible"

    Thank you for your help,
    James
     
  10. toto2003

    toto2003

    Joined:
    Sep 22, 2010
    Posts:
    528
    Hi trooper, any news with the photoshop to uitoolkit plug in? That s look awesome!
     
  11. QI

    QI

    Joined:
    Oct 27, 2012
    Posts:
    229
    Hi , Why I use your game center plugins when build is always have many error?
    How to fix it. I mean when build an Xcode project, Xcode link.
     
  12. toto2003

    toto2003

    Joined:
    Sep 22, 2010
    Posts:
    528
    Hi
    Does this asset work on windows phone and blackberry? I don t have these phone at the moment .
     
  13. JuiceReis

    JuiceReis

    Joined:
    May 28, 2013
    Posts:
    29
    Not to sure if I've set up the UIToolkit properly or something but when I begin to position the buttons for example,
    bottom right, it stays around 2/3s of the screen and not at the bottom of the screen.
    Any ideas why this is happening?

    I have got other plugins included in my project. Could another part of my project be causing this?

    Regards.
     
  14. AtomicChimp

    AtomicChimp

    Joined:
    Aug 9, 2011
    Posts:
    47
    @Prime -- Any suggestions for how I might approach this?
     
  15. Ginebro

    Ginebro

    Joined:
    Aug 8, 2013
    Posts:
    17
    I have installed the uitoolkit and tried all the demo scenes, while draw calls are really low the fps are actually only about 60-70fps but i didnt put any extra content in them, it's it just that way or i'm supposed to get more fps? anyone got more fps in the demos?
     
  16. trooper

    trooper

    Joined:
    Aug 21, 2009
    Posts:
    746
    No news on it as an asset on the asset store, it's functional for internal use but we hope that we'll turn it into a product when we finish up our current game.

    We're going to turn it into a photoshop extension (half done already) so it's nice and easy to use.

    The next version supports auto translations for any language you want, bitmap fonts are created automatically etc :)
     
  17. Ginebro

    Ginebro

    Joined:
    Aug 8, 2013
    Posts:
    17
    The scripts are coded in NET 4.0, i had to rebuild all my scripts because of a bug and all UIToolkit scripts are giving me error, because the optional function parameters are not supported anymore in Unity 4.2 witch has NET 2.0, anyone knows a way to convert NET 4.0 to 2.0? it's a LOT of work to fix all the UIToolkit scripts manually...
     
  18. MaximilianPs

    MaximilianPs

    Joined:
    Nov 7, 2011
    Posts:
    321
    I don't understand, there is no more Border option on the UIProgressBar ?

    Code (csharp):
    1. healtBar = new UIProgressBar("nrgBar.png", "nrgBorder.png", 5, 3, 1, 1);
     
    Last edited: Aug 27, 2013
  19. crushy

    crushy

    Joined:
    Jan 31, 2012
    Posts:
    35
    Guys I'm having a problem right now that's delaying our current project. I want to change a button's sprite, permanently. However if I use .setSprite or .uvFrame to set it, it gets reset to the older one upon as soon as the button is clicked. Can anyone point me towards the right direction?
     
  20. unitynewb

    unitynewb

    Joined:
    Feb 22, 2009
    Posts:
    242
    Has anyone got this to work with Windows phone? I was going to replace ArrayList with List in MiniJSon because thats the only thing that I know would give Windows Phone a problem, but I'm not sure if that will be my only problem. Right now this will crash on a Windows Phone if I try to recreate my UIToolKit. (I always recreate it because on some phones this would cause a flickering button bug which I never figured out, so I just destroy it and recreate it when I have to redraw my buttons)

    This will cause the Windows phone to crash about 90 percent of the time.

    Code (csharp):
    1.  
    2.             buttonObject = new GameObject("UIToolkit - Buttons2");
    3.             buttonObject.SetActive (false);
    4.             buttonObject.transform.parent = UI.transform;
    5.             buttonObject.layer = 8;// 8 is UI
    6.             buttonToolkit = (UIToolkit)buttonObject.AddComponent("UIToolkit");
    7.             buttonToolkit.texturePackerConfigName = "sheet1.02";
    8.             buttonMaterial = new Material (Shader.Find ("UIToolkit/Alpha Enabled (Default)"));
    9.             buttonToolkit.material = buttonMaterial;
    10.             buttonObject.SetActive (true);
    11.             buttonToolkit.loadTextureAndPrepareForUse();
    12.             Destroy(GameObject.Find("UIToolkit - Buttons"));
    13.             buttonObject.name = "UIToolkit - Buttons";
    14.  
     
  21. Zelek

    Zelek

    Joined:
    Jun 12, 2010
    Posts:
    87
    Has anyone had any luck getting UIToolkit to work with sprites that have been trimmed in the TexturePacker atlas? I found this github page from a couple years ago that outlines the problem and solution quite well, but it appears to have been abandoned: https://github.com/prime31/UIToolkit/issues/48

    If any freelancers familiar with UIToolkit are interested in adding this functionality, shoot me a message - I'd be happy to pay for your time.
     
  22. SyntaxTerror

    SyntaxTerror

    Joined:
    Jul 14, 2012
    Posts:
    32
    I've just started using it for creating health and other progress bars similar in style to C&C-style games. The problem is, like one poster has noticed, the UIProgressBar has been messed with. I've been following a very good video tutorial on it but it's now out of date.

    At the moment I'm getting something displayed but it's not what I'm expecting ... just a white progress bar. There's obviously an issue with it trying to locate the image in the spritesheet since the width of the progress bar image is set to zero. I need the width reported so I can accurately position the progress bar on the screen.

    This is what I have at the moment:

     
  23. chuwito

    chuwito

    Joined:
    Aug 31, 2013
    Posts:
    3
    Has anyone know how to make a ScrollView using UIToolkit????
     
  24. crushy

    crushy

    Joined:
    Jan 31, 2012
    Posts:
    35

    I'm not sure if this is any help but UIToolkit runs fine on Windows 8 RT which should be the same hardware and functionality unless I'm mistaken.
     
  25. crushy

    crushy

    Joined:
    Jan 31, 2012
    Posts:
    35
    I've had that problem. The solution is fairly easy :)

    Code (csharp):
    1. progressBar.value = 1f;
    2. progressBar.resizeTextureOnChange = true;
    The problem you're having is simply that since the progress bar starts out empty, it's main texture will be set to size 0.


    I think I've also had some fun issues with doing left to right or vice versa and having a negative width, just a heads up.
     
  26. gfxguru

    gfxguru

    Joined:
    Jun 5, 2010
    Posts:
    107
    What is the best way to manage buttons and ui elements, ie , to show and hide.
    Drawing all gui and then hiding/unhiding elements according to need or should i remove/destroy
    elements and recreate them when needed ?
     
  27. lukasz-o

    lukasz-o

    Joined:
    Oct 11, 2013
    Posts:
    1
    Perfect library.
    Is there any way to purchase license? I'd like to use it in commercial projects.
     
    Last edited: Oct 30, 2013
  28. Dm-Smirnov

    Dm-Smirnov

    Joined:
    Oct 30, 2013
    Posts:
    4
    How make hd and sd font in BMFont? If i make two fonts with size 36 and 72, and put bigger in Texturepacker then it will work incorrect(artefacts...).
     
  29. dontonka

    dontonka

    Joined:
    May 15, 2013
    Posts:
    20
    Hello, UIToolkit is amazing so far able to do all what I wanted.

    Now I'm hitting a wall, hopefully some Unity and Prime31/UIToolkit expert can help.

    I basically want to show a 3d asset (a humanoid character) in my UI interface (using UIToolkit), is this possible to achieve this with UIToolkit (as a second goal I would like even to make it rotate by detecting swipe gesture but that's another story)? I guess not, but if someone could give me an idea how to do it that would be awesome.

    Thanks!
    Don T.
     
  30. AndreasC

    AndreasC

    Joined:
    Feb 12, 2013
    Posts:
    31
    Hello ! :)
    I'm having a issue with UIToolkit...
    My buttons and my UIScrollableHorizontalLayout doesn't show up on my Android device, but it shows up in the editor.
    Does anyone have a similar problem and how did you fix it ?

    - Andreas
     
  31. Nels83

    Nels83

    Joined:
    Oct 27, 2012
    Posts:
    20
    Hey propeller,
    did you end up finding a fix for this? I'm having the same issue....

    Does anyone have any insight into this?
     
  32. Nels83

    Nels83

    Joined:
    Oct 27, 2012
    Posts:
    20
    Did some testing, still haven't been able to figure this out, but here are some observation/details.

    -The vertical scrolling works well on iOS(iPad3/iPhone4) and in unity editor.

    -works OK on android with sprites (galaxyS1, nexus 4, nexus 7), a bit laggy though.

    -does not work well on android (extreme lag) if there are UITextInstances parented to the sprites
    (test1: 25 sprites, each with 1 child uitextinstance consisting of the letter "a". Test2: 25 sprites, each with a child sprite that had another child sprite with yet another child, for a total of 100 sprites. Test2 was more responsive on android even though it had double the elements in the scroll container)

    UPDATE: Works well on Nexus 5. Still no luck on older devices....
     
    Last edited: Jan 31, 2014
  33. amit_nath30

    amit_nath30

    Joined:
    Dec 5, 2013
    Posts:
    5
    Can anybody give me a way how to add UIGridLayout inside UIScrollableHorizontalLayout, with functionality like android, iOS screens
     
  34. kobilica

    kobilica

    Joined:
    Jan 4, 2014
    Posts:
    3
    Hello, I have a problem!

    When I open demos in Unity 4.3.2f1, some things are messed. No examples worked! (Even kitchen sink)

    I changed UI.cs script, I renamed Awake() to Start(), then scripts started to work. How another thing, that is funky. When I make resolution enough big that UIToolkit switches to "2X" aka HD textures, things F*** up. No errors, but looks like reading from texture atlas is very broken, because I can't see almost nothing, I see only animation (character in kitchen sink), and even that looks like some random chopped of buttons.

    How to fix this?

    Also loading bar is funked (visible only in SD), bar is ok and visible but I cannot see background of bar.
     
  35. Explodinator

    Explodinator

    Joined:
    Dec 1, 2012
    Posts:
    1
    Does anyone know how to change the Z-Order of UI elements?

    I've tried changing the sprite.position.z, changing the depth value the sprites are instantiated at, changing sprite.client.transform.position.z, nothing seems to actually affect the Z-Ordering of sprites except the order in which they are created. Am I doing something wrong?
     
  36. FrankHHansen

    FrankHHansen

    Joined:
    Jan 14, 2014
    Posts:
    10
    Am I allowed to publish a game to Android market using this Toolkit? even if it profits? Or do I need to buy a license for that?
    (I'll add it to the credits)
     
  37. ThomasMcGrath

    ThomasMcGrath

    Joined:
    Jan 20, 2014
    Posts:
    2
    It seems like the license is in relation to uitoolkit being used as part of an asset bundle or on its own, and not in relation to being part of a game or program. Not sure if it is concrete but I'm using this as justification https://github.com/prime31/UIToolkit/issues/155
     
  38. FrankHHansen

    FrankHHansen

    Joined:
    Jan 14, 2014
    Posts:
    10
    Hmm :/
    he writes:
    so I'm wondering if when he says "or as part of any other game asset." that he means combined in some game kit or like that. or he means publishing his game that uses this tool.

    If the case is that I'm not allowed to publish a game using his tool, then what is it good for? unless I can buy a commercial license for it.
     
  39. Nels83

    Nels83

    Joined:
    Oct 27, 2012
    Posts:
    20
    I had a similar issue when switching my project over to 4.3. I think it is due to the script execution order.
    http://docs.unity3d.com/Documentation/Components/class-ScriptExecution.html
    I set the UI.cs script to execute before the Default Time (look at above link), and it fixed it.

    UIToolKit is free to use in any game that you publish(even if you charge for the game), the license restriction is so that you do not sell the UIToolKit system as your own tool. For example: you are not allowed to package the UIToolkit as a Unity Asset and sell it on the Unity Asset Store.

    That is my understanding of it
     
  40. oldngrey

    oldngrey

    Joined:
    Jul 25, 2013
    Posts:
    23
    Hmm,
    When a new download of UIToolkit gave errors when simply executing any of the demo scenes, I started looking around but found no official answer. (Unity 4.33f1 on Windows 8.1, running the demos in the editor)


    As suggested by Nels83: I changed the UI.cs to execute before 'default time' but that had no effect on the errors I was getting.
    As suggested by koblica: I then renamed the UI.cs 'awake' method to 'start'. All demos began to work except ColorPicker.

    So it's a timing issue, but to me both suggestions appear to conflict a bit.....


    Is there are an official fix for UIToolkit working out of the box even on the demo scenes?
     
    Last edited: Jan 26, 2014
  41. Vitor_r

    Vitor_r

    Joined:
    May 23, 2013
    Posts:
    93
    I got the same problem.
    I changed the Awake() to Start(). And most of the demos worked.
    Then i put the UI.CS to execute before default time, and kept Start() and all of them worked.

    But this dont seem correct, waiting for a official solution too :)
     
  42. Kobix

    Kobix

    Joined:
    Jan 23, 2014
    Posts:
    130
    I hope it will be fixed soon :)
     
  43. MrCodex

    MrCodex

    Joined:
    Jun 16, 2013
    Posts:
    1
    When I first set up UIToolkit, everything seems to be fine, however when I close my scene and reload it (without even changing anything), I get these errors:

    NullReferenceException
    UISpriteManager.loadTextureAndPrepareForUse () (at Assets/Plugins/UIToolkit/BaseElements/UISpriteManager.cs:102)
    UI.Awake () (at Assets/Plugins/UIToolkit/UI.cs:117)

    NullReferenceException: Object reference not set to an instance of an object
    UISpriteManager.textureInfoForFilename (System.String filename) (at Assets/Plugins/UIToolkit/BaseElements/UISpriteManager.cs:174)
    UIButton.create (.UIToolkit manager, System.String filename, System.String highlightedFilename, Int32 xPos, Int32 yPos, Int32 depth) (at Assets/Plugins/UIToolkit/UIElements/UIButton.cs:33)
    UIButton.create (.UIToolkit manager, System.String filename, System.String highlightedFilename, Int32 xPos, Int32 yPos) (at Assets/Plugins/UIToolkit/UIElements/UIButton.cs:26)


    any ideas?
    edit: My code is just one simple button in the scene, and this error also happens with the demoScenes. Apparently, there is something wrong with saving your scene :/
     
    Last edited: Feb 19, 2014
  44. yoger

    yoger

    Joined:
    Feb 5, 2013
    Posts:
    1
    Got the same issue as MrCodex
     
  45. moneymaker

    moneymaker

    Joined:
    Mar 2, 2014
    Posts:
    2
    I am also having the same issue as MrCodex. I am using Unity 4.3.4 and Windows 8.1.

    This library seems outdated. There are other similar free alternatives?
     
  46. trooper

    trooper

    Joined:
    Aug 21, 2009
    Posts:
    746
    A new version of UIToolkit rebranded to XUI is coming soon, it has some breaking changes but it will eventually replace UIToolkit and will be the foundation of a larger UI solution.
     
  47. moneymaker

    moneymaker

    Joined:
    Mar 2, 2014
    Posts:
    2
    I developed my game using UIToolkit and although it works fine in the editor it fails with built version because of UITollkit elements. Issue: https://github.com/oddgames/UIToolkit/issues/161
    Can you estimate new version release date? It may be not accurated. I just want to know if I wait, try to fix the actual version or change GUI toolkit.
     
  48. SleepyDevil

    SleepyDevil

    Joined:
    Aug 5, 2013
    Posts:
    30
    With UnityGUI i change my menus on runtime with
    switch
    case menu1
    break;
    case menu2
    break;
    ....
    But since you cant take UIToolkit in your void Update() menu I dont really know if there is any way to change my menu on runtime without loading a new scene for everything, any ideas?
     
  49. Kashrlyyk

    Kashrlyyk

    Joined:
    Aug 16, 2011
    Posts:
    17
    The new name might be a problem: https://github.com/xui/xui
     
  50. trooper

    trooper

    Joined:
    Aug 21, 2009
    Posts:
    746
    At this stage I would switch to a new UI system as there wont be a fix for a while. But if you could provide an error log for me and the code where it fails I might be able to help you fix it.