Search Unity

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

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

  1. fmarkus

    fmarkus

    Joined:
    May 22, 2010
    Posts:
    181
    Hello,
    For whatever reason, my game is slightly zoomed in on iPhone. Any idea?
    Thanks!

    f.
     
  2. unikronsoftware

    unikronsoftware

    Joined:
    May 21, 2011
    Posts:
    1,287
    Hi fmarkus,

    I will need a lot more info to work out or even guess what could've gone wrong. Can you get in touch by email (support at unikronsoftware dot com)?

    unikron
     
  3. paraself

    paraself

    Joined:
    Jun 30, 2012
    Posts:
    139
    Hiii Unikron

    First of all thanks for making this wonderful plugin which saves me a lot time. But I have problem with the default xy plane. I want to use 2dtk and unitysteer at same time in my game. But unitysteer's default plane is xz plane, and it seems impossible to change it. Is it possible to make 2dtk working in xz plane?
    Thank you for help;)
     
  4. unikronsoftware

    unikronsoftware

    Joined:
    May 21, 2011
    Posts:
    1,287
    Hi paraself,

    The plane axis is intentional - a lot of code relies on this and as such simply changing it to XZ would mean a LOT of unnecessary work, both real time and offline. I can't put this in the main versions for this reason, but I will be happy to walk you through the changes should you only need this for a specific use-case. If possible, let me know in a bit more detail what you're planning on doing, and I'll see how 2dtk can be made to fit better.
     
  5. paraself

    paraself

    Joined:
    Jun 30, 2012
    Posts:
    139
    Hi Unikron

    Thanks for your quick reply. Now I know that it's impossible for now for 2dtk to work in other planes. I will try to get in touch with the author of UnitySteer to see if it's possible to make UnitySteer to work in XY plane. What I am trying to do is to apply steer behavior to sprites made by 2dtk. Many thanks for your help.

    Regards
     
  6. unikronsoftware

    unikronsoftware

    Joined:
    May 21, 2011
    Posts:
    1,287
    Its not impossible - its only a few lines to change basic sprite behaviour should you want to do that. It depends on what other features you need.

    Another option - you could just add all sprites to a parent gameobject and rotate that to sit on xz.

    Really depends on what you need specifically.
     
  7. arkon

    arkon

    Joined:
    Jun 27, 2011
    Posts:
    1,122
    Can you clip sprites with tk2d? What I mean by that is if you have a sprite say 100px x 100px and only want it to draw the bottom 50 pixels or top 30 pixels, is this possible? Or basically an ability to give the sprite a source rectangle that is smaller than the sprites rect.
     
  8. unikronsoftware

    unikronsoftware

    Joined:
    May 21, 2011
    Posts:
    1,287
    Hi,

    This isn't in the official distribution, but there are 2 different examples of this in the private support forum - one using a software clipping rect, and another using a shader. I've linked both of the threads for your convenience.

    http://unikronsoftware.com/2dtoolkit/forum/index.php/topic,398.0.html
    http://unikronsoftware.com/2dtoolkit/forum/index.php/topic,115.0.html

    You will need to have registered your copy to get access.

    unikron
     
  9. Robota

    Robota

    Joined:
    Feb 7, 2012
    Posts:
    82
  10. arkon

    arkon

    Joined:
    Jun 27, 2011
    Posts:
    1,122
    Well that's annoying, I can't view those links as I don't own tk2d. I currently use ex2d and I'm not happy with the way it clips, so was going to check out your tool instead, but I don't want to make another costly purchase just to find out if it does what I need it to do. Do you have a trial version so I can try it. I'd know within a couple of days if it was was I needed.
     
  11. unikronsoftware

    unikronsoftware

    Joined:
    May 21, 2011
    Posts:
    1,287
    We don't have a trial. Unlike ex2d we distribute as full source so that could be a bit problematic. However, drop me an email at support@unikronsoftware.com and I'll see what I can do to help you out here.
     
  12. unikronsoftware

    unikronsoftware

    Joined:
    May 21, 2011
    Posts:
    1,287
    No, I've not heard of it. Thanks for sharing the link. I'll see if it will be possible to provide a back-end to this solution - I don't see why it wouldn't be possible.
     
  13. Ocid

    Ocid

    Joined:
    Feb 9, 2011
    Posts:
    476
    Don't know if you're aware of it but theres also a Farseer port that works within Unity. Theres a thread in the forum here somewhere but the link to the site with the package and setup tutorials is http://www.catsinthesky.com/
     
  14. unikronsoftware

    unikronsoftware

    Joined:
    May 21, 2011
    Posts:
    1,287
    That's brilliant, thanks for sharing that! I'll look into integrating 2D Toolkit into these packages in addition to Physx. Having a pluggable module which supports multiple physics engines could be very good indeed.
     
  15. YUSHI

    YUSHI

    Joined:
    Jul 7, 2012
    Posts:
    19
    Last edited: Jul 7, 2012
  16. unikronsoftware

    unikronsoftware

    Joined:
    May 21, 2011
    Posts:
    1,287
    Can you create a mockup of what you're after in photoshop? That looks like its on cloth...
     
  17. Uttpd

    Uttpd

    Joined:
    Feb 27, 2010
    Posts:
    114
  18. unikronsoftware

    unikronsoftware

    Joined:
    May 21, 2011
    Posts:
    1,287
    How exactly are you trying to draw the sprite here? Are you just trying to desaturate the region outside a set circle? Is it always a circle? What platforms are you targetting? Is there only one of these objects ever?
    Need a lot more detail to answer this properly.
     
  19. Uttpd

    Uttpd

    Joined:
    Feb 27, 2010
    Posts:
    114
    I´m just learning my way, working on desktop Win7

    from background to camera I have

    a) terrain sprites in color
    b) white version of the terrain sprite
    c) sprite with a hole (with a Alpha gradient) - circular shape,

    Working on the on the XZ plane, all the sprites are 2dToolkit; a) and b) using the tk2d default shader and c) using the Mask shader code I posted.

    As it is now, the Alpha information is used as a "Base Alpha cutoff" enabling me to resise the diameter off the circle (using the Alpha)
    Instead I want the Alpha Information to be used as a Transparent blending mask --> make the b) sprite semi transparent on the edge so that the color sprite a) and the white b) blend from full color to white


    hope it makes sense :confused:


    PS: I´v 2 tk2d cameras. One (depth 0) sees everything except b) and c) sprites wish are only seen by the second camera (depth 1)
     
    Last edited: Jul 7, 2012
  20. RecursiveFrog

    RecursiveFrog

    Joined:
    Mar 7, 2011
    Posts:
    350
    Hi there, I'm running into a strange issue regarding texture compression on Android.

    I have one specific project in which my Android build's textures crunch down to a hideous mess. This doesn't happen in other tk2d projects I've exported for Android. Do you have any pointers on how to troubleshoot issues like this?
     
  21. unikronsoftware

    unikronsoftware

    Joined:
    May 21, 2011
    Posts:
    1,287
    The textures are standard Unity textures, and as such they should use the same Unity pipeline as everything else. A few things to try out to work out whats going on -

    1. In Edit > Project Settings > Quality, make sure the default android texture quality is set to "Full Res".

    2. Make sure there isn't an override on the texture itself.

    3. Load the atlas PNG into photoshop or something and make sure its OK...

    4. Drag the png alone into a new project to see what you get.

    Let me know what you find and hopefully we'll be able to work out whats gone wrong here.
     
  22. unikronsoftware

    unikronsoftware

    Joined:
    May 21, 2011
    Posts:
    1,287
    You can do this with just one sprite (without the 3 as described above), but it'll require programmable shaders. What platform are you targetting?
     
  23. Uttpd

    Uttpd

    Joined:
    Feb 27, 2010
    Posts:
    114
    --> Desktop

    Just one sprite? .. I need them yo be different sprites/ objects. the c) sprite follows the player (the others are static, representing the terrain features)
     
  24. unikronsoftware

    unikronsoftware

    Joined:
    May 21, 2011
    Posts:
    1,287
    You can pass the player position into the shader, and the shader does the masking directly. Saves you drawing multiple passes. Being desktop, a shader like this should be really cheap.
     
  25. YUSHI

    YUSHI

    Joined:
    Jul 7, 2012
    Posts:
    19
    I want to two coler of the seams,create mixing effect.And coler is red encounter blue ,can slowly turn blue.
     
    Last edited: Jul 8, 2012
  26. RecursiveFrog

    RecursiveFrog

    Joined:
    Mar 7, 2011
    Posts:
    350
    D'oh! Thanks, Unikron it was that simple. Android was at half res.
     
  27. unikronsoftware

    unikronsoftware

    Joined:
    May 21, 2011
    Posts:
    1,287
    You could use a custom shader to do this, or just 2 alpha blended sprite layers with varying alpha which you gradually move on top of each other. The camera is looking right at the middle of the two, and sees them blend.
     
  28. Girl + Robot

    Girl + Robot

    Joined:
    Nov 30, 2009
    Posts:
    74
    I bought the 2DToolKit a few days ago, and wow I am very impressed. I took quite a bit of time to decide which of the "2D" packages to buy, and I am very happy with my choice. I am also VERY impressed with Unikron, he seems very apt to keep making improvements to the software. I am very happy, with the direction the software is going. Great job Unikron!
     
  29. unikronsoftware

    unikronsoftware

    Joined:
    May 21, 2011
    Posts:
    1,287
    Thanks for the kind words Girl + Robot :)
     
  30. bali33

    bali33

    Joined:
    Aug 14, 2011
    Posts:
    232
    Hi,

    Is there any lite or demo version of 2D Toolkit in order to have a look and test it before make the decison to buy it ?

    Thank you.
     
  31. unikronsoftware

    unikronsoftware

    Joined:
    May 21, 2011
    Posts:
    1,287
    We don't have a trial as the product is distributed as source code, but drop me an email with what you're looking for and perhaps I can help there. (support@unikronsoftware.com)
     
  32. Gnatty

    Gnatty

    Joined:
    May 17, 2012
    Posts:
    77
    Perhaps better than a demo, is there a list of games people have made with this toolkit?
    Just watching the first page videos now. Very impressive.
     
  33. unikronsoftware

    unikronsoftware

    Joined:
    May 21, 2011
    Posts:
    1,287
    Thats a good question. I know of a few projects using it and some published on android AppStore, but I'm not sure which ones I'm allowed to say anything about... If anyone can post what they've done with 2D Toolkit that would be pretty awesome :)
     
  34. Threeli

    Threeli

    Joined:
    Jul 9, 2012
    Posts:
    15
    I cannot show my project as of yet - it is too early. As soon as I have something to show off (which I feel shows off your product in a worthy light) I will do so. For now I can only assure timid/unsure buyers that this product is excellent.
     
  35. Timso

    Timso

    Joined:
    Jul 13, 2012
    Posts:
    1
    Hi
    is it possible to give every letter a little offset, so that every letter is overlapping a little bit? if not, is there a simple way to hack it in? ^^
     
  36. unikronsoftware

    unikronsoftware

    Joined:
    May 21, 2011
    Posts:
    1,287
    You can change this by modifying the "Spacing" parameter on the textmesh. A negative value will bring them closer together.
     
  37. unikronsoftware

    unikronsoftware

    Joined:
    May 21, 2011
    Posts:
    1,287
    I've added a showcase section to our forum. Some developers have posted their games there, I'm sure more will come!
    http://unikronsoftware.com/2dtoolkit/forum/index.php/board,9.0.html
     
  38. Ocid

    Ocid

    Joined:
    Feb 9, 2011
    Posts:
    476
    I don't have anything to currently show and probably won't for quite a while. I'm pretty ill again and probably going to start something new when I'm better but for what its worth I thoroughly recommend 2d Toolkit. Best 2d solution on the asset store IMO.
     
  39. lasshi

    lasshi

    Joined:
    Apr 19, 2011
    Posts:
    3
    good day sir

    want to know before buying:
    can this system (gameobject created with 2dtoolkit) used in perspective world, and is tk2dcamera perspective?
    just want to know can this be mixed with normal 3d models.

    thx in advance, and sry if question is dumb :p
     
  40. unikronsoftware

    unikronsoftware

    Joined:
    May 21, 2011
    Posts:
    1,287
    Hi lasshi,

    The gameobject created by 2D Toolkit can be used in a perspective world, no problem with that. Sample "6 - button and 3d sprites" shows this in action. Here is a webplayer. http://www.unikronsoftware.com/2dtoolkit/webplayer/sample6/

    tk2dCamera isn't perspective, its an off center ortho camera with pixel sized world units. The origin of this camera is the bottom left of the screen.
     
  41. eskimojoe

    eskimojoe

    Joined:
    Jun 4, 2012
    Posts:
    1,440
    I have NGUI, 2D Toolkit, ex2D


    My vote goes to 2D toolkit.

    - The easiest to use,
    - fastest to code upon and seems to be faster for Unity Editor to go into Play/Stop,
    - full sources,
    - very responsive customer service.
    - they add features very fast,
    - very little codes to write / or to needed to access their run-time.


    - easy to add pixel-perfect buttons from artist.
    - easy to add pixel-perfect fonts.
    - easy to add pixel-perfect sprites and animations

    - no fiddling around with alignment issues!
    - no fiddling around with font issues!
    - no fiddling around with super-imposed or unnecessary extra components needed in scene hierarchy !

    - easy to add custom music to controls,
    - easy to derive and make your own controls (combo-box, sliders, checkbox, scroll-chat window, batched sprites).


    - prefabs don't lose their settings all the time!
    - prefabs don't have alignment issues or wrong colors!


    A++
     
  42. lasshi

    lasshi

    Joined:
    Apr 19, 2011
    Posts:
    3
    thank you for the fast answer, your product starts to seem better every second :)
     
  43. unikronsoftware

    unikronsoftware

    Joined:
    May 21, 2011
    Posts:
    1,287
    Just read that. Hope you feel better soon.
     
  44. malcroff

    malcroff

    Joined:
    Jul 3, 2012
    Posts:
    4
    Is there a way to flip a sprite (and/or animation) just like cocos2d and other engines? The current flip functions dont seem to work right!!!!
     
  45. eskimojoe

    eskimojoe

    Joined:
    Jun 4, 2012
    Posts:
    1,440
    - Need word-wrap for label. (e.g., goes above 50 characters, wrap to next line).
     
  46. Ocid

    Ocid

    Joined:
    Feb 9, 2011
    Posts:
    476
    Thanks unikron. Don't know how long it'll be though. Hopefully not too long, want to get back to working with Unity and 2D Toolkit :D
     
  47. pushbyte

    pushbyte

    Joined:
    Apr 1, 2012
    Posts:
    9
    Does 2D Toolkit handle text wrapping? I'm starting a 2D project and am weighing the options as far as 3rd party packages go. 2DTK looks great, but I'd like a package that can handle all of the GUI stuff I'd need to do, which includes word wrapping and dialogue boxes.
     
  48. eskimojoe

    eskimojoe

    Joined:
    Jun 4, 2012
    Posts:
    1,440
    For the dialog boxes, you paint your own window and make it as a batched sprite. There are buttons there.
    For the word-wrap, you have to add a \r\n to the line. But I wish this was automatic.


    But it was much better than fiddling around with alignments and crazy screen/font crashing issues (happens with their competitors).
     
  49. pushbyte

    pushbyte

    Joined:
    Apr 1, 2012
    Posts:
    9
    I figured as much, I was just hoping there was built-in wordwrapping. For instance, UI Toolkit lets you define a text instance width and wraps anything that goes beyond that. Anyways, I'm sure I can write my own wrapping method assuming I can calculate the width of a string using the bitmap font info, I just thought it would be nice if it came standard.
     
  50. Mars91

    Mars91

    Joined:
    Mar 6, 2012
    Posts:
    572
    What is better on mobile? A single 2048x2048 atlas or two different 1024x1024 atlas?