Search Unity

ex2D - the best 2D sprite solution for Unity [RELEASED]

Discussion in 'Assets and Asset Store' started by johnny_karas, Aug 24, 2011.

  1. shinriyo_twitter

    shinriyo_twitter

    Joined:
    Aug 12, 2011
    Posts:
    328
    hi jwu

    Thanks for replying
    Good work!
     
  2. myprabath01

    myprabath01

    Joined:
    Sep 15, 2011
    Posts:
    33
    Thanks first of all. and I need to use multiple Atlus only for Main character. so in that case. its using(Player exSprite) one material. right. so only one draw call at one time right. right.
     
  3. myprabath01

    myprabath01

    Joined:
    Sep 15, 2011
    Posts:
    33
    Quick Question. Will you guys going to release GUI support In near futur ?
     
  4. johnny_karas

    johnny_karas

    Joined:
    Sep 20, 2010
    Posts:
    704
    One draw call for the character.

    We are doing some GUI for our own project base on ex2D. We probably release these things in near future.
     
  5. mgebra

    mgebra

    Joined:
    Sep 22, 2010
    Posts:
    27
    Hello jwu,

    I am using ex2D and it is great product, but I have problem. maybe it is uv mapping.

    I build Atlas (using default parameters) from 4 different solid color textures and 4 sprites from them, but all of them have problem 0.5 px from the beginning, u can see in attachment. also if it was not clear we where expecting to see no color leackage at the borders of the sprites. Is it a bug or am I doing something wrong? Picture is increased 4 times from default size.

    I can send you unity package of this test if you wish.

    Thanks
     

    Attached Files:

    Last edited: Nov 16, 2011
  6. johnny_karas

    johnny_karas

    Joined:
    Sep 20, 2010
    Posts:
    704
    Hi mgebra,

    I must check this by the texture you import. Can you send me these textures, let me confirm the problem in my PC. Thank you in advance!
     
  7. johnny_karas

    johnny_karas

    Joined:
    Sep 20, 2010
    Posts:
    704
    We are working hard for the next version of ex2D --- v1.2.2 .

    In this new version, we introduce a Layer Manager system. Here is a screen shot of it:



    The layer editor provide an interface to help you organize game objects by layer. In the scene, the layer will eventually calculate as z position for each game object, this release you from sorting the draw order for the game. It is especially useful for a action game which the character and enemy are animated by skeleton! For more details about the new Layer System, read the documentation here: http://www.ex-dev.com/ex2d/wiki/doku.php?id=manual:advance:layer2d_usage

    We also improve the performance in rendering sprites by using sprite manager. The whole changes of ex2D v1.2.2 can be found here:

    New Features
    • Add Rebuild Prefabs in Edit/ex2D/Command menu. (Help user update prefabs in project when atlas changes).
    • Add New Layer System, exLayerMng, exLayer.

    Changes
    • Disable atlas texture Read/Write settings after atlas texture built
    • Use exSpriteMng update sprites instead of updating all sprites in each LateUpdate function (it also longer the battery life and the device will not get too hot )
    • Fix sprite animation play hidden sprite will show last frame at first.
    • Change exSpriteAnimation.Play() to exSpriteAnimation.PlayDefault() so it will not conflict with Play(string) when setup animation event in animation view.
    • Disable exSpriteAnimation when animation paused or stopped.
    • Disable exSpriteAnimation when the game started but no default animation played.
    • Remove exPlane.plane, instead we assume user working in XY coordinate space
    • Remove exLayer2D, use new layer system exLayerMng instead of it.

    Bug Fix
    • Fix sprite animation trigger event that play current animation again has no effect.
    • Fix SoftClip not update immediately when sprite postion changed.
    • Fix sprite font line height calculate wrong when scaled
    • Fix animation helper keep reporting error when upgrade ex2D.
    • Fix spriteMng commit error when guiBorder is null
    • Fix exScreenPosition, exViewportPosition not work with Perspective camera

    The new version is ready and waiting for submit to the asset store. In the meantime, we are developing the new website and provide more solution for user to buy this product.

    Since a lot of people asking buy the produce with source code in a higher price, we are now prepare two different solution for ex2D, the ex2D indie and ex2D pro. We also provide upgrade solution for ex2D indie user. These service will come up in the next few days.

    The price will be adjust once we submit to the asset store, hurry up for you last chance! And thank you for your support and advice to help us improve ex2D better and better!
     
    Last edited: Nov 18, 2011
  8. Lisan

    Lisan

    Joined:
    Jun 17, 2009
    Posts:
    220
    And still no chance to fix Asset Server issues and crashes on synching in this version?
     
  9. johnny_karas

    johnny_karas

    Joined:
    Sep 20, 2010
    Posts:
    704
    Yes, we are going to make a big changes in v1.3.0, so Asset Server and crashes will be fixed in there. We also going to do a minimal fix for this problem in v1.2.3, which will at least prevent crashes and correctly sync the data.
     
  10. myprabath01

    myprabath01

    Joined:
    Sep 15, 2011
    Posts:
    33
    I have another question,
    In my Game the Background size is 6000 * 400. so I cut the whole image into 6 pieces and made them as 6 spirite objects. Then i put them in my game as one image. But the problem is the connecting margins of the sprites are visible when playing the game. They are not visible in the scene view(when player moves around margin area, margin is start to blinking as black line). I even set the filtering to Point Mode and Filtering as Clamp this help little bit but not really.

    About layering management thing, it will be really good update for ex2d. I sufferd lots of problem with rendering order of ex sprites. right now im manually updates the depth. Im really wanted Layer Manager system.
     
  11. johnny_karas

    johnny_karas

    Joined:
    Sep 20, 2010
    Posts:
    704
    Hi myprabath01,

    To prevent black line and blinking, you need to set filter mode to Point in atlas texture (not the original).
     
  12. silver-wind

    silver-wind

    Joined:
    May 8, 2007
    Posts:
    19
    Hi,
    I've a problem with the custom resolution.
    How can I fix sprite position when this option is enabled ?
     
  13. johnny_karas

    johnny_karas

    Joined:
    Sep 20, 2010
    Posts:
    704
    Hello rineddy,

    Can you tell me more about the custom resolution? Do you mean the custom size option in sprite? And what is the problem with fixing position of a sprite?

    Thanks in advance.
     
  14. michaelkamms

    michaelkamms

    Joined:
    Nov 21, 2011
    Posts:
    7
    Hi,

    Would like to know whether this is possible, let say:

    1. Create a series of images for walking. I only created walk images facing right.

    2. So, I create an animation, and put this animation on the AnimatedSprite.

    3. Now I have an animation walking towards right.

    The question:

    Let say, I created a script and attached to the AnimatedSprite. I want to detect if the user press right arrow key, I want the character to walk towards right (facing right of course), otherwise if the user press left arrow key, I want the character to walk towards left (facing left).

    So, how can reuse the same animation (e.g. by flipping it), so that I can animate the walking animation which facing left with the same set of animation? via C# script. (The detecting key, direction, walking, moving the sprite I am able to achieve).

    Or I have to create the animation (and the images) that facing left as well?


    Thanks
     
  15. johnny_karas

    johnny_karas

    Joined:
    Sep 20, 2010
    Posts:
    704
    Hi michaelkamms

    You just need to call exSprite.HFlip() to flip the texture horizontally.
     
  16. michaelkamms

    michaelkamms

    Joined:
    Nov 21, 2011
    Posts:
    7
    OK, I think i got the idea. Thanks for the prompt reply.

    ex2D is a wonderful plugin!

    Thanks
     
  17. decoy98

    decoy98

    Joined:
    Aug 30, 2011
    Posts:
    36
    Hi, I am fairly new to ex-2d and I have watched both the tutorials you have in YouTube.
    My problem is that I am using windows, and when I click at sprite animation editor, it only gives me "Please select a sprite animation clip", and nothing else.... no "Create", no other stuff than the one you have on the tutorial.

    Please help
     
  18. johnny_karas

    johnny_karas

    Joined:
    Sep 20, 2010
    Posts:
    704
    Hi decoy98,

    The video in tutorial is an old version of ex2D. In the new version, the way to create atlas and sprite animation is changed in right click mouse in Project Window. For more details, you can read the documentation of them here:

    http://www.ex-dev.com/ex2d/wiki/doku.php?id=manual:atlas_editor:create_and_edit_atlas

    http://www.ex-dev.com/ex2d/wiki/doku.php?id=manual:sprite_anim_editor:create_sprite_anim_clip
     
  19. johnny_karas

    johnny_karas

    Joined:
    Sep 20, 2010
    Posts:
    704
    ex2D v1.2.2 is now available in asset store. Check the first page for more details

    We also upgrade our web page for selling the product in our web site directly

    The new version of ex2D provides a new Layer System which can help you organize the z order of 2D object easily. Read this for more details
     
  20. mahdi68

    mahdi68

    Joined:
    Nov 20, 2011
    Posts:
    9
    Hi , i try to play sprite animation but it`s not working ! i use this code :
     
  21. johnny_karas

    johnny_karas

    Joined:
    Sep 20, 2010
    Posts:
    704
    Hi madhdi68,

    The code you paste is correct. The problem is did you add this "ninja_run" animation in your exSpriteAnimation ? And does it use the name "ninja_run" in the list ?
     
  22. jfmoulin

    jfmoulin

    Joined:
    Aug 28, 2009
    Posts:
    13
    Hi jwu,

    I updated Ex2D and tried again to create and assign all from script. It works until I select the object. Before I select it, I can check the values of atlas and index and they seem ok. When I select the object, it clears itself. exSprite.atlas becomes null as soon as the object is selected.

    The code is the same as the script I pasted some days ago with the correction you told me with exSpriteEditor.

    If you want to test it, replace the previous OnGUI with this one.
    Code (csharp):
    1. void OnGUI()
    2. {
    3.     if( Event.current.type == EventType.DragExited )
    4.     {
    5.         Texture2D tex = DragAndDrop.objectReferences[0] as Texture2D;
    6.         if( tex != null )
    7.         {
    8.             exSprite sprite = _ObjTest.GetComponent< exSprite >();
    9.             exAtlasDB.ElementInfo elementInfo = exAtlasDB.GetElementInfo( exEditorHelper.AssetToGUID( tex ) );
    10.             exSpriteEditor.UpdateAtlas( sprite, elementInfo );
    11.             sprite.Build( tex );
    12.         }
    13.     }
    14. }
    Am I doing something something wrong or I there another bug ?
     
  23. johnny_karas

    johnny_karas

    Joined:
    Sep 20, 2010
    Posts:
    704
    Hi jfmoulin,

    I think we both miss to assign textureGUID for the sprite. So the correct code is:

    Code (csharp):
    1.  
    2.     void OnGUI()
    3.     {
    4.         if ( Event.current.type == EventType.DragUpdated ) {
    5.             DragAndDrop.visualMode = DragAndDropVisualMode.Copy;
    6.         }
    7.         else if( Event.current.type == EventType.DragPerform )
    8.         {
    9.  
    10.             DragAndDrop.AcceptDrag();
    11.  
    12.             Texture2D tex = DragAndDrop.objectReferences[0] as Texture2D;
    13.             if( tex != null )
    14.             {
    15.                 Debug.Log("yes");
    16.                 exSprite sprite = _ObjTest.GetComponent< exSprite >();
    17.                 exAtlasDB.ElementInfo elInfo = exAtlasDB.GetElementInfo( exEditorHelper.AssetToGUID(tex) );
    18.                 exSpriteEditor.UpdateAtlas( sprite, elInfo );
    19.                 sprite.textureGUID = exEditorHelper.AssetToGUID(tex);
    20.                 sprite.Build(tex);
    21.             }
    22.         }
    23.     }
    24.  
    What I add above is the line:

    Code (csharp):
    1.  
    2.                 sprite.textureGUID = exEditorHelper.AssetToGUID(tex);
    3.  
    Enjoy!
     
  24. mahdi68

    mahdi68

    Joined:
    Nov 20, 2011
    Posts:
    9
    Hi , i attach my project picture , i add animations but it`s not working
     

    Attached Files:

    Last edited: Nov 23, 2011
  25. johnny_karas

    johnny_karas

    Joined:
    Sep 20, 2010
    Posts:
    704
    Hi mahdi68,

    Looks good for your settings. So where is the script component you attached at? In the Player or in the SpriteObject? I can see you use Player as parent of SpriteObject. If you attach script in Player, then it will not play animation for SpriteObject. Otherwise, I can't figure out what is wrong here.

    Can you send me a package of this issue ? Thanks in advance.
     
  26. mahdi68

    mahdi68

    Joined:
    Nov 20, 2011
    Posts:
    9
    i added script to player ! i change it to SpriteObject and it`s work fine , thanks
     
  27. michaelkamms

    michaelkamms

    Joined:
    Nov 21, 2011
    Posts:
    7
    Hi,

    Is there a way to hide the red border for softclip during game play?

    Thanks
     
  28. jfmoulin

    jfmoulin

    Joined:
    Aug 28, 2009
    Posts:
    13
    @jwu

    Yep, that was the missing part. It works now.

    Thanks Jwu !
     
  29. johnny_karas

    johnny_karas

    Joined:
    Sep 20, 2010
    Posts:
    704
    Hi michaelkamms,

    The red border should hide while the game is playing, unless you enable the Draw Gizmos in the game I guess. :)
     
  30. michaelkamms

    michaelkamms

    Joined:
    Nov 21, 2011
    Posts:
    7
    Sorry, my fault. I have Gizmo on... sorry...
     
  31. warboss

    warboss

    Joined:
    Nov 24, 2011
    Posts:
    5
    Hi,

    How is possible to create exSprite from directly c# script?
    I have try something like this :

    GameObject sprite_hex;
    sprite_hex = new GameObject( "sand" );
    sprite_hex.transform.Translate( 65, 0.5f, 100 );

    exSprite sprite = sprite_hex.AddComponent<exSprite>();
    sprite.SetSprite( sprite_atlas_hex, sprite_atlas_hex.GetIndexByName( "hex-sand" ) );

    And i see GameObject in scene list but it's not showing on screen.

    Please help. Thanks!
     
  32. johnny_karas

    johnny_karas

    Joined:
    Sep 20, 2010
    Posts:
    704
    Hi warboss,

    I've fix this bug. If you subscribe our Newsletter, you will receive the daily fix version including this. Thanks for your report!
     
  33. warboss

    warboss

    Joined:
    Nov 24, 2011
    Posts:
    5
    Hi jwu,

    Thanks for fast reply.

    Actually after add this line of code :

    sprite.ForceUpdateMesh( sprite.meshFilter.mesh );

    Sprite start drawing ok. I don't know is't correct wise method for creating mesh this way for exSprite.
    Also how is safely to destroy GameObject with exSprite that was created directly from code above.
    Thanks
     
  34. johnny_karas

    johnny_karas

    Joined:
    Sep 20, 2010
    Posts:
    704
    Hi warboss,

    Yes, that is the line I added to fix the problem. You can just call GameObject.Destroy ( obj ); to destroy a GameObject with sprite component on it.
     
  35. donlien

    donlien

    Joined:
    Apr 13, 2009
    Posts:
    229
    Hi, jwu, I know ex2D just 5 minutes ago. : ) But I am interested of ex2d and want to ask some question.

    1. When will you release "2D Skeleton Animation Editor" ?
    2. Can I use 1 GameObject to manage multiple sprites ? (since too many GameObjects are not good for performance.)
    3. Can I download forever after I paid ? How does it work ? I will receive an email with URL link to download it ?

    Thank you very much.
     
    Last edited: Nov 25, 2011
  36. johnny_karas

    johnny_karas

    Joined:
    Sep 20, 2010
    Posts:
    704
    Hi donlien,

    1. The 2D Skeleton Animation Editor still under developing and in a low priority, we are currently focus on v1.3.0 which will solve problem when working with Asset Server.

    2. Well, you can use a GameObject control sprites, but one sprite component can only attach in one GameObject. BTW: I don't think the number of GameObject will cause performance problem if they are not have Script Component that use complex Update function. You are free to create 100-200 sprite objects in a scene if you draw them properly.

    3. The Asset Store will make sure you have paid the plugin and helps you update to a new version. So don't worry about that.

    Any questions, feel free to ask us.
     
  37. surfacedstudio

    surfacedstudio

    Joined:
    Oct 30, 2011
    Posts:
    3
    Hello jwu,

    I have just downloaded ex2D 1.2.2 and am trying out the new Layer editor :)

    I have created 2 sprites in my scene, RedSprite and BlueSprite. Since they both have the same Z position (0) and I created RedSprite first, BlueSprite is drawn on top of RedSprite by default.
    I have assigned an ExLayer script to both of them and ordered them in the Layer manager to draw RedSprite on top of BlueSprite (see screenshot).

    When I start the game however, the layers do not seem to be applied correctly - BlueSprite is still drawn on top of RedSprite.
    Once I click 'Update' (while the game is running), the issue is fixed, but only for the duration of the game.
    Clicking 'Update' outside of game mode does not resolve this issue, it seems the layers are not correctly applied on startup of the game?
    Am I missing something to make the sprites get sorted when the game is started?

    Regards,
    Tobias

     
  38. donlien

    donlien

    Joined:
    Apr 13, 2009
    Posts:
    229
    Thank you for reply. : )

    Re 2: I'd like to know if I create 200 sprites on iPhone 3GS, will it can still has performance of 40 ~ 60 FPS at least ? ( I remember it will slow down drop below 30 FPS if there are about over 150 game objects in the same time even only draw 2 polygons of every game object in my own test on iPhone 3GS. )

    Re 3: I think I'd like to buy it on your web site http://www.ex-dev.com/ to save my money. :) It is reliable for re-downloading plugin, too, isn't it ? Can I get a download URL for update in future if I buy it from your web site ?

    BTW, have you any plan to make some "trail" (moving like a ghost flying swaying with a transparent tail) or "laser" object to add into this plugin ?
     
  39. johnny_karas

    johnny_karas

    Joined:
    Sep 20, 2010
    Posts:
    704
    Hi Tobias,

    Do you re-assign the z position to the Red or Blue Sprite while the game running ? Can you send this package to me so that I can reproduce it in my machine.

    Thanks in advance.
     
  40. johnny_karas

    johnny_karas

    Joined:
    Sep 20, 2010
    Posts:
    704
    Hi donlien,

    For 3GS, I think it can't afford that much sprite in a scene. The draw performance is relate with the number of the polygon and the draw calls of them. So you have to save both of them to get a good FPS in Unity3D.

    You can buy it in our web store and still get download to a new update. The service we choose support it, so don't worry. But we recommend people using Unity Asset Store for better upgrade experience.

    We didn't have plan to make trail or laser yet. But I will consider that, looks pretty good and reasonable.
     
  41. CapnCromulent

    CapnCromulent

    Joined:
    Sep 7, 2010
    Posts:
    45
    Hi,

    I'm upgrading to v 1.2.2 RC3 and found a bug with the layer manager. If you attempt to drag an object that does not already have an exLayer component into the layer manager editor window, ex2d will hang on a progress bar. At the very least, it should reject the object, but it would be nicer if it automatically (and recursively) added the component to the object.

    Thanks!
     
  42. johnny_karas

    johnny_karas

    Joined:
    Sep 20, 2010
    Posts:
    704
    Hello CapnCromulent,

    It will add the layer component to a object that don't have it when dragging into layer manager. So it could be a bug for this. Can you give me a unity-package with this problem? Thanks in advance.
     
  43. CapnCromulent

    CapnCromulent

    Joined:
    Sep 7, 2010
    Posts:
    45
    I sent a email with a sample package and repro steps to support@ex-dev.com. I couldn't include my game assets, but I can still reproduce the bug with the supplied object hierarchy.

    Please let me know if you need anything else.
     
  44. warboss

    warboss

    Joined:
    Nov 24, 2011
    Posts:
    5
    Hi Jwu,

    Also it's will be great to have in ex2d feature like this :

    Polygon collider editor - Set up polygon colliders quickly and efficiently (see 2d toolkit)

    Thanks!
     
  45. decoy98

    decoy98

    Joined:
    Aug 30, 2011
    Posts:
    36
    Man, thank you so much Wu Jie!!!
     
  46. johnny_karas

    johnny_karas

    Joined:
    Sep 20, 2010
    Posts:
    704
    Hi warboss,

    Actually, we have put it in our TODO list. But would be done after v1.3.0 comes out.
     
  47. warboss

    warboss

    Joined:
    Nov 24, 2011
    Posts:
    5
    Great! Thanks!
     
  48. warboss

    warboss

    Joined:
    Nov 24, 2011
    Posts:
    5
    Also for c# scripting this code :

    Code (csharp):
    1.                    
    2. sprite_hex = Instantiate( sprite_animation_prefab ) as GameObject;
    3.  
    4. exSprite sprite = sprite_hex.GetComponent<exSprite>();
    5. sprite.SetSprite( hex_animation.frameInfos[0].atlas, hex_animation.frameInfos[0].index );
    6. sprite.ForceUpdateMesh( sprite.meshFilter.mesh );
    7.  
    8. sprite_hex.AddComponent<exCollisionHelper>();
    9. exCollisionHelper collision = sprite.collisionHelper;
    10. collision.AddBoxCollider();
    11.  
    12. exSpriteAnimation sprite_animation = sprite_hex.GetComponent<exSpriteAnimation>();
    13. sprite_animation.AddAnimation( hex_animation );
    14. sprite_animation.defaultAnimation = hex_animation;
    15. sprite_animation.PlayDefault();
    Have a problem with BoxCollider updated for animation. Especially Z offset is a different for the same gameobject without animation and Physics.Raycast don't have a hit.

    But after modify to this :

    Code (csharp):
    1.  
    2. sprite_hex.AddComponent<exCollisionHelper>();
    3. exCollisionHelper collision = sprite.collisionHelper;
    4. collision.AddBoxCollider();
    5.  
    6. collision.autoLength = false;
    7. collision.autoResizeCollision = false;
    Z offset becomes the same to gameobject without animation and Physics.Raycast have a hit.
     
    Last edited: Nov 28, 2011
  49. decoy98

    decoy98

    Joined:
    Aug 30, 2011
    Posts:
    36
    Hi again wu jie, I was wondering what code I can write to play a running animation when I press the left or right arrow button?
     
  50. myprabath01

    myprabath01

    Joined:
    Sep 15, 2011
    Posts:
    33
    Im gettings this Error when i select ex2d Prefab. Tried many times. No solution. Using Ex2d 1.2.2 and Unity pro 3.4.2

    NullReferenceException
    exPlaneEditor.OnInspectorGUI ()
    exSpriteBaseEditor.OnInspectorGUI ()
    exSpriteEditor.OnInspectorGUI ()
    UnityEditor.InspectorWindow.DrawEditors (Boolean isRepaintEvent, UnityEditor.Editor[] editors, Boolean eyeDropperDirty)
    UnityEditor.InspectorWindow.OnGUI ()
    System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture)