Search Unity

2D Toolkit - 2D in Unity made simple [RELEASED]

Discussion in 'Assets and Asset Store' started by unikronsoftware, Jun 16, 2011.

  1. BTStone

    BTStone

    Joined:
    Mar 10, 2012
    Posts:
    1,422
    Ah yes, it was black. Changed it to white, did the job! Thank you very much! :)
     
  2. appleunited

    appleunited

    Joined:
    Dec 25, 2010
    Posts:
    103
    Can we expect an updated video tutorial or game project soon?
     
  3. unikronsoftware

    unikronsoftware

    Joined:
    May 21, 2011
    Posts:
    1,287
    Theres a game sample being developed now that 2.0 is out - the whack-a-mole game we mentioned a while ago. Expect a written walkthrough to building the game first before anything else.
     
  4. appleunited

    appleunited

    Joined:
    Dec 25, 2010
    Posts:
    103
    Nice. Hope it deals with multi resolution support and 2D UI kit as well.
     
  5. Alectora

    Alectora

    Joined:
    Nov 18, 2012
    Posts:
    8
    Hi, just wanna drop a testimonial. I'm really glad I bought 2D toolkit. The 1:1 on tk2d sprite really helps me a lot to adjust my stuff, also the fact that it is completely loose coupling with Unity gives me an easy way to mix 2D and 3D assets. The editor that helps produce atlases (nope, multi-atlases) on the fly is also a significant feature I admire. The fact that it works well with Spine 3rd party tools is also great, because rather than I spent more dollars for texture packer software, I got both texture packer and 2D tool plugin for Unity with 2D toolkit. I tried and tested both for one day just for quick environment setup (along with Spine) and I'm not messed up with little stuff to begin with.

    Thanks! :D
     
  6. unikronsoftware

    unikronsoftware

    Joined:
    May 21, 2011
    Posts:
    1,287
    Thanks for the kind words :)
     
  7. Ben-BearFish

    Ben-BearFish

    Joined:
    Sep 6, 2011
    Posts:
    1,204
    Hey Unikron,

    I was wondering if it would be possible to add a dial/wheel UI component as a part of 2D Toolkit's new UI system. I think it would be very beneficial to many developers, and it'd be nice not to have to implement ourselves. Prime31's opensource UIToolkit has an example of it, but it's burdened with other code in UIToolkit. Great job on the 2DToolkit by the way.
     
  8. outtoplay

    outtoplay

    Joined:
    Apr 29, 2009
    Posts:
    741
    Crushing the sprite animation competition...now looking down the barrel at NGUI.
    Props to team Unikron, as they man the frontlines of the war on graphic asset overload.

    B.
     
  9. Scramasaxe

    Scramasaxe

    Joined:
    Sep 2, 2011
    Posts:
    18
    I upgraded an older project to Unity 4.0, and upgraded to 2dtoolkit 2.0, and I get spammed by this error for all my sprites:
    IndexOutOfRangeException: Array index is out of range.
    tk2dSprite.OnDrawGizmos () (at Assets/Plugins/tk2d/Code/Sprites/tk2dSprite.cs:220)
     
  10. unikronsoftware

    unikronsoftware

    Joined:
    May 21, 2011
    Posts:
    1,287
    Have you run Setup for JS once again after updating?
    Did you follow the steps in the migration guide?
    http://unikronsoftware.com/2dtoolkit/doc/2.00/migration_guide.html
     
  11. unikronsoftware

    unikronsoftware

    Joined:
    May 21, 2011
    Posts:
    1,287
    Added to our wishlist Trello, we'll be opening this for public voting in due course :)
     
  12. limdorn

    limdorn

    Joined:
    Jan 5, 2012
    Posts:
    56
    Hi.
    I´m want to use in 2dtk2.0 the 2dtkcamera and 2dtkUI but the ui don´t appeared in 2dtkcamera.
    whats wrong?
     
  13. eedok

    eedok

    Joined:
    Sep 21, 2009
    Posts:
    194
    If you're adding things to the wish list for the UI could I ask for the ability to change the carat position on UIInput through mouse and arrow keys, and if you're really brave maybe even text selection and being able to delete selected areas of text?
     
  14. unikronsoftware

    unikronsoftware

    Joined:
    May 21, 2011
    Posts:
    1,287
    If you want to use the tk2dCamera, the sprites must be created with "Use tk2dCamera" ticked. The default UI sprites arent.
     
  15. limdorn

    limdorn

    Joined:
    Jan 5, 2012
    Posts:
    56
    Thanks.
    Now all sprites appeared in screen but if I drag*a BasicButton*prefab*into*the*scene it´s not working.
    Help me please. :(:(
     
  16. unikronsoftware

    unikronsoftware

    Joined:
    May 21, 2011
    Posts:
    1,287
    As the documentation / tutorial says the UI prefabs are configured for orthographic size 1. If you want to change it you can do so while changing the graphics.
     
  17. limdorn

    limdorn

    Joined:
    Jan 5, 2012
    Posts:
    56
    I read documentation and it is not working but I found the problem: In BasicButton inspector , in tk2dUIItem , it´s necesary to Fit the Collider.
    Thanks for your help.

    $screen.jpg
     
  18. unikronsoftware

    unikronsoftware

    Joined:
    May 21, 2011
    Posts:
    1,287
    Please post as much detail as possible next time so I can help more quickly :)

    In most cases I (and the programmer on tk2dUI) prefer to simply work with a 1.0 ortho camera. Thats why its set up the way it is, but if there are enough people using tk2dCamera for one reason or another, then I can create a sample for that too. Please post on our forum to request: http://unikronsoftware.com/2dtoolkit/forum/index.php
     
  19. yuriythebest

    yuriythebest

    Joined:
    Nov 21, 2009
    Posts:
    1,125
    Greetings! Say I have a tk2d textmesh - is it possible to have different size text inside one text mesh? for example:

    some text here LARGE TEXT small text again
     
  20. unikronsoftware

    unikronsoftware

    Joined:
    May 21, 2011
    Posts:
    1,287
    Hi!
    Its not possible at the moment.
     
  21. yuriythebest

    yuriythebest

    Joined:
    Nov 21, 2009
    Posts:
    1,125
    thanks for the quick response!
     
  22. unikronsoftware

    unikronsoftware

    Joined:
    May 21, 2011
    Posts:
    1,287
  23. BTStone

    BTStone

    Joined:
    Mar 10, 2012
    Posts:
    1,422
    Is there a way to determine the last played animation? I don't think it's a Toolkit-Problem, but I could use some information :)

    I have problems to change from one animation to another, here is the scenario:


    1. The character walks around (walking animation) - pressing the Movementbuttons
    2. An Enemy appears
    3. Character walks into Enemy and is hit (hit animation) - pressing STILL the movementbuttons, while the hitanimation is played
    4. Character is stuck in the hitanimation and "walks" with this animation, till I release the Buttons.


    I'm working with PlayMaker and manage the StateChanging with FSMs.
    I wanted to tackle this problem by knowing the last played animation and storing it in a Variable, checking: if that button was pressed and this animation played, play the Buttons' animation (don't know though if that's the best way to achieve this)

    And another thing:

    Where exactly can I look up the clipID of the animations I made?
     
  24. unikronsoftware

    unikronsoftware

    Joined:
    May 21, 2011
    Posts:
    1,287
    You shouldn't really use the animation state to work out what to do next. I can't comment too much about PlayMaker, but I strongly suggest keeping state internally to your game logic, and then from that, work out what animation to play. So - what I'm saying is, don't rely on the animation to tell you what it was playing. Doing this will result in your logic being quite fragile, and you'll likely end up with behaviour you don't intend.
     
  25. Nub3h

    Nub3h

    Joined:
    Aug 23, 2012
    Posts:
    56
    Hi there,
    I have a question about the 2D Toolkit UI that comes with the plugin. I've been using the native Unity GUI system so far and I find it quite good except the fact that all the GUI Skin custom styles need the 2D assets to be a single resource (a.k.a. more draw calls), therefore preventing the use of a spritesheet, which 2d Toolkit allows if I understand correctly.

    One thing I don't understand from the docs and tutorials is how the layout of the different gui components is defined and works in 2D Toolkit. In Unity GUI if I use the GUILayout class I can, for example, put a button on the top-left corner of the screen and this one will always be on the top-left corner no matter if I deploy on an iPhone4, iPhone5 or an Android which have all different screen sizes. How is this done with 2d Toolkit? Is there a way to define a layout or do I need to always reposition the GUI objects depending on the screen size?

    I haven't found any tutorial about this topic and for me this is one of the crucial aspects since I develop for both iOS and Android on different screen resolutions and the GUI layout is one of the most time consuming parts.

    Thanks for the reply! ;)
     
  26. unikronsoftware

    unikronsoftware

    Joined:
    May 21, 2011
    Posts:
    1,287
    The components are defined via drag and drop visually. Using the tk2dAnchor system, you can anchor UI elements to screen corners. Basically you just attach the UI components to the anchors.

    It really depends what kind of GUI you're trying to create here. We've created some pretty complex nice looking UIs but ultimately there are situations where an immediate mode GUI system like UnityGUI will be easier to use. If you post on our forum with what you're looking to create I'll be happy to offer more concrete advice.

    http://unikronsoftware.com/2dtoolkit/forum/
     
  27. morton fink

    morton fink

    Joined:
    Mar 13, 2013
    Posts:
    86
    I use two computers for unity3d development. Can I use 2d toolkit with one license on both?
     
  28. unikronsoftware

    unikronsoftware

    Joined:
    May 21, 2011
    Posts:
    1,287
    Yes
     
  29. profanicus

    profanicus

    Joined:
    Nov 23, 2009
    Posts:
    295
    Hi, I am looking to migrate from ex2D, to that end I've been reading through the TK2D docs and forums and so far it all seems pretty great.

    So, before I take the plunge I was wondering:
    1. Is the new camera mode currently available in the beta? If not, about how far off are we from getting that?
    2. Do tilemaps work well in perspective? In the Sprite reference I saw there was a "1:1" button to scale sprites to a pixel perfect size based on the camera distance, so is there an equivalent for tilemap tiles when using perspective?
    3. Does using layers in tilemaps give you parallax when using a perspective camera?

    Thanks!
     
  30. unikronsoftware

    unikronsoftware

    Joined:
    May 21, 2011
    Posts:
    1,287
    1. The new camera mode isn't quite ready yet, but you can use a normal orthographic camera and start development, and simply attach it later to get the scaling and other goodness. It is designed to be added on like that.

    2. It depends on what you want to do. If you're just using it for parallax then that'll be fine (as long as you set transparencySortMode -> Orthographic).

    3. It can if you need it to. You can increase layer separation to increase parallax.You should still set the transparency sort mode to avoid weird sorting though.
     
  31. profanicus

    profanicus

    Joined:
    Nov 23, 2009
    Posts:
    295
    Excellent, thanks for the quick reply. Though you didn't quite answer point 2 fully - is there a function to scale tilemap tiles to pixel perfect in perspective? I didn't see any tilemap equivalent to sprites' "1:1" in the docs/tutes anywhere. For example, if I shift my layers back in the scene to get deeper parallax in perspective, then I need to size the layer tiles up right?
     
  32. unikronsoftware

    unikronsoftware

    Joined:
    May 21, 2011
    Posts:
    1,287
    Yup. You will have to rescale for that. There isn't an equivalent of the 1:1 function, but it really is quite easy to work out what the scale should be. Post on the support forum (www.unikronsoftware.com/2dtoolkit/forum) and I'll be happy to help - it'll likely just get lost in this thread. You can work out exactly what the scale should be to be pixel perfect at a set distance.

    There is also another way to do parallax using ortho cameras + multiple cameras. There is a sample of this in the private support forum. This works reasonably well too, and you don't have to worry about scaling and everything tends to look "correct" in scene view. I would prefer this method over a perspective camera for tilemaps with layers.
     
  33. ahaykal

    ahaykal

    Joined:
    Apr 18, 2010
    Posts:
    117
    Dear UnikronSoftware,

    I have no question to ask, I just want to thank you for this excellent plugin, your awesome support your great dedication to helping out people.

    Thank you from me and a whole bunch of people!
     
  34. BTStone

    BTStone

    Joined:
    Mar 10, 2012
    Posts:
    1,422
    Hey Unikron,

    I have that MenuButton in my game, when it's pressed the game is paused (Time.timeScale = 0) and the MenuUI is shown (GameObjects are moved into screen with HOTween and ignoring the TimeScale). So in this Menu there are some 2DToolkit Animations, but I guess these are calculated with deltaTime and since the timeScale is still set to 0 they won't be played at all. Is there a way around this?
     
  35. unikronsoftware

    unikronsoftware

    Joined:
    May 21, 2011
    Posts:
    1,287
    @ahaykal - You're welcome, and thanks for supporting us.
     
    Last edited: Jun 20, 2013
  36. unikronsoftware

    unikronsoftware

    Joined:
    May 21, 2011
    Posts:
    1,287
    You can easily modify the tk2dAnimatedSprite class, but if you're using 2D Toolkit 2.0 - there is a better way. Create the animator as you would normally, but set .enabled to false. Attach your own script to it, and call animator.UpdateAnimation( ... ) with your own "time" variable there. You can step the animation using whatever measure of time you like.
     
  37. BTStone

    BTStone

    Joined:
    Mar 10, 2012
    Posts:
    1,422
    The Animationprocess and the TimeScaling are done in PlayMaker so i still use the old Version.
     
  38. unikronsoftware

    unikronsoftware

    Joined:
    May 21, 2011
    Posts:
    1,287
    If you're using playmaker, I don't think there is any direct way to do this, you will have to dig into the code a bit. If you need a patch to make it always ignore timescale, then that might be easy enough to do?
     
  39. morton fink

    morton fink

    Joined:
    Mar 13, 2013
    Posts:
    86
    When the Filter Mode of the Sprite Collection Texture is set to Bilinear the Sprite is antialiased even if shown at its original/pixelperfect size.

    I'm trying to show a tk2dsprite not antialiased/pixelperfect when its not scaled but antialiased when it is being scaled. Is there a way to do this? (other than switching bewteen two textures)
     
    Last edited: Jun 21, 2013
  40. unikronsoftware

    unikronsoftware

    Joined:
    May 21, 2011
    Posts:
    1,287
    It shouldn't? Are you positive you're drawing it at pixel perfect size? Is this on device or when running in game? Do you have the origin of the pixel at a pixel boundary - i.e. if its between pixels, then it is likely to display blurred.
    Also have you checked this?
    http://unikronsoftware.com/2dtoolkit/forum/index.php/topic,612.0.html
     
  41. morton fink

    morton fink

    Joined:
    Mar 13, 2013
    Posts:
    86
    $PixelPerfectTest-Bilinear.png thanks. i checked everything.
    the texture is blured in editor and in the windows build.
    i made screenshoot which captures the most settings. as you can see the white circle is not crisp. this changes when the texture is switched to Point. maybe you can see what´s wrong?
     
  42. unikronsoftware

    unikronsoftware

    Joined:
    May 21, 2011
    Posts:
    1,287
    Is the game window resolution set to 1024x768, and more importantly, do you have 1024x768 pixels in your game window? It doesn't count if you resize the window so it physically has less than 1024x768 pixels, it WILL filter then.
     
  43. morton fink

    morton fink

    Joined:
    Mar 13, 2013
    Posts:
    86
    yes, its 1024x768 resolution and window/screen-size in the editor and in the build.

    with Premultiplied Alpha set true the circle looks more crisp but then there is something like a gray outline.
     
  44. unikronsoftware

    unikronsoftware

    Joined:
    May 21, 2011
    Posts:
    1,287
    With premultiplied alpha, did you change the shader too? If you can, send a repro case to support at unikronsoftware dot com. It will make things a lot easier if you can do that :)
     
  45. morton fink

    morton fink

    Joined:
    Mar 13, 2013
    Posts:
    86
    ok, thanks, i just sent you a file.
     
  46. unikronsoftware

    unikronsoftware

    Joined:
    May 21, 2011
    Posts:
    1,287
  47. Original-Big-Dan

    Original-Big-Dan

    Joined:
    Feb 5, 2013
    Posts:
    10
    Possibly a cheeky question, but is 2DToolkit coming up in any asset store sales? I'd really like to pick it up but I can't stretch to the full price (Until my game becomes a worldwide winning franchise! ;))
     
  48. unikronsoftware

    unikronsoftware

    Joined:
    May 21, 2011
    Posts:
    1,287
    We don't usually get more than a couple days notice when something goes on a sale, and I don't have any advance knowledge of their plans :(
     
  49. Original-Big-Dan

    Original-Big-Dan

    Joined:
    Feb 5, 2013
    Posts:
    10
    No problem, thanks for the reply!
    I'm going to ask my significant other very nicely and convince her of the benefits. :D
     
  50. G_Koko

    G_Koko

    Joined:
    Aug 25, 2012
    Posts:
    30
    Hi, I just update the 2D Toolkit and now when I try to see the images on the Sprite Animation Editor or in the Inspector I´m getting only a pink image instead or the original image from the Sprite Collection... Any idea on how I may fix this? (I already converted some tk2dAnimatedSprite to tk2dSpriteAnimator and nothing is changing). Thanks in advance for your help!