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. striche

    striche

    Joined:
    Jan 4, 2011
    Posts:
    61
    We purchased ex2D awhile back, but have not updated to Unity 4 yet. The latest version in Asset Store requires Unity 4. Is it possible to get the last version of ex2D that was Unity 3.5 compatible, and does this version contain the "rebuild sprites in all selected scenes" tool?
     
  2. mntcarp

    mntcarp

    Joined:
    Dec 12, 2011
    Posts:
    25
    Hi guys! I'm having a big issue here, and I don't know how to solve it, any help would be appreciated.
    The thing is, when I click on the Play Button, ALL my ex2d sprite animations appear with the red background, meaning the sprites are not in the Atlas, which is wrong, because they are there.
    I have to reimport everything eveytime to get the animations right, but we go back to the issue when we hit Play.
    Any suggestions??
    Thank you all in advance!

    Edit: It happens when I make the build too. By the way, I'm developing for android.
     
    Last edited: Apr 11, 2013
  3. Saioman

    Saioman

    Joined:
    Apr 16, 2013
    Posts:
    3
    Hi!

    For those who wants "Rebuild sprites on all scenes" without updating ex2d and/or Unity3d, this is my patch to do it:

    Place Ex2dPatches.cs on Editor subfolder... and select "Editor -> ex2d patches -> Rebuild all scenes" to run it

    ---
    Saioman
    Super Awesome Hyper Dimensional Mega Team
    http://battlepairs.blogspot.com/
     
  4. striche

    striche

    Joined:
    Jan 4, 2011
    Posts:
    61
    Hopefully this does the trick. Thanks!
     
    Last edited: Apr 16, 2013
  5. MihaPro@HC

    MihaPro@HC

    Joined:
    Dec 25, 2012
    Posts:
    2
    Where the author ex2D?
     
  6. bellotje

    bellotje

    Joined:
    Apr 23, 2013
    Posts:
    4
    Hi to all,

    I'm going crazy on this very simple thing but I don't seem to find the answer in this thread (or others).
    I simply would like to change dynamically a sprite object with an image contained in an atlas.
    So according to the button we click on, I have to load the corresponding image in an atlas (detailed image) an display it.


    Here is the code, "thumb" being the exSprite object in which the detailed image should be displayed:
    exSprite thumb = GameObject.Find(....);
    thumb.SetSprite(detailsAtlas, detailsAtlas.GetIndexByName(detailImageName);
    thumb.renderCamera = myCurrentCamera;

    I tried adding these lines but nothing changes, no image is displayed in the sprite :(
    Anyone has an idea ? this should be sooo basic but I can't find the trick

    thanks !
     
  7. moopi

    moopi

    Joined:
    Apr 24, 2012
    Posts:
    39
    Big thanks Saioman, that script save my day!

    Br,
    - Moopi
     
  8. sonofbryce

    sonofbryce

    Joined:
    May 19, 2009
    Posts:
    111
    striche, if you e-mail the author he should send you a 3.5 compatible version of the plugin. He helped me out with that same problem.

    Saioman, thanks for that script!

    I have a question for anybody, has anyone found a way to tint a exSprite to a white color? With the version I have, the color attribute can only tint to a darker color. I want my sprite to flash a bright white. Any ideas?
     
  9. ugur

    ugur

    Joined:
    Jun 3, 2008
    Posts:
    692

    hey sonofbryce, nice to see you around here =) In case you wonder who i am, maybe you remember me as tomsamson on flashkit =)
    Regarding ex2D: When has the author replied to your email? I wondered cause they didn't get back to some emails of mine for quite a while and seeing they aren't active anymore in the forums either for quite a while, nor was the package updated since december, i saw ex2D as sadly discontinued hence trying all other options next to working on own stuff myself for such 2D usage ends.
    Regarding the coloring i'd probably rather do that in the shader (depends on the use case).
     
  10. sonofbryce

    sonofbryce

    Joined:
    May 19, 2009
    Posts:
    111
    hey tom! err, ugur! haha

    I had done short e-mail exchanges with both guys in late Jan/early Feb so if they haven't been responding I guess they're busy with other stuff. They're working on a game as well, right? I'm loving ex2D so I figure I'll keep using it until I run into some kinda problem or limitation I can't get around.

    Good idea about the shader though. I figure I could make a second color channel for the shader and use it to add color to the material. Any idea on how to target that shader color property through code? Haven't tried that yet for anything beyond the default "_Color".
     
  11. ugur

    ugur

    Joined:
    Jun 3, 2008
    Posts:
    692
    hey there =) nice to meet you again =)
    and haha, yeah, i know it must be funny seeing someone with a different name after all those years calling him by one of his web nicknames =)
    You can continue calling me tom if you prefer that, to me both are fine =) Having been a community lead in the flash scene so long tomsamson became sorta my second name anyway =)

    Yeah, cool if it still works ok for what you do, sadly not for me. They didn't update the package since december and seem to have vanished from forums/ email support/ their website etc since at least around february. I dunno if they still actually work on any games as team either since their (previously quite active) blog hasn't been updated anymore in quite a while either. Dunno really if they are way busy or just split up or who knows, maybe being in China got picked up by the government for i don't know what :I
    If its not the last option or some other serious issue, dunno, i find it a real bummer when someone creates such a package which is meant to be used in large parts of people's projects and then just becomes unreachable for months on end (especially when the package they sell is closed source in the asset store hence then cumbersome to address bugs and other shortcomings oneself).
    So yeah, since with the project i work on right now ex2D just is too buggy and lacks a bunch of features we need and then the developers being unreachable for a long while, i ditched using it completely now and use other stuff instead.

    You can easily set the color in a material accessing it by using material.color or material.SetColor. Then you only need to know how the color property you want to change is called in the shader, common ones in the builtin shaders are:
    Code (csharp):
    1. _Color,_SpecColor,_Emission,_ReflectColor, _TintColor

    Here's a simple code example in js if you use a particles/additive shader:
    Code (csharp):
    1.  
    2. public var tintColor: Color;
    3.  
    4. function Start () {
    5.     renderer.material.SetColor ("_TintColor", tintColor);
    6. }
    7.  
    Depending on your use case, yeah, the builtin shaders may not cut it for your coloring needs, then you need to create a modified version of one of those or create a custom one from scratch.
    You can download the source of the builtin shaders here: http://unity3d.com/unity/download/archive
    Seeing your post i also posted a feature request for adding better tinting features to the builtin shaders here: http://feedback.unity3d.com/unity/all-categories/1/hot/active/proper-tinting
     
    Last edited: Apr 26, 2013
  12. bellotje

    bellotje

    Joined:
    Apr 23, 2013
    Posts:
    4
    Nobody ?
     
  13. sonofbryce

    sonofbryce

    Joined:
    May 19, 2009
    Posts:
    111
    Hey bellotje, I hope you've solved this problem by now! But I think I had a similar issue. Forgot what my exact problem was, but I think it had something to do with the references to the atlas not working or something like this.

    Some example code I used.

    Code (csharp):
    1.  
    2.  
    3.     // sprite
    4.     private exSprite _sprite;
    5.     private exAtlas _atlas;
    6.    
    7.     public string spriteNameSoundOn = "ui_sound_on";
    8.     public string spriteNameSoundOff = "ui_sound_off";
    9.    
    10.     private int spriteIndexOn;
    11.     private int spriteIndexOff;
    12.  
    13. Awake() {
    14.         _sprite = GetComponent<exSprite>();
    15.         _atlas = _sprite.atlas;
    16.        
    17.         spriteIndexOn = _sprite.atlas.GetIndexByName(spriteNameSoundOn);
    18.         spriteIndexOff = _sprite.atlas.GetIndexByName(spriteNameSoundOff);
    19. }
    20.  
    21. SetSpriteOn() {
    22.         // and set it like this
    23.         _sprite.SetSprite(_atlas, spriteIndexOn);
    24. }
    25.  
    26.  
    It looks similar to what you've done, just make sure that the atlas isn't null and the GetIndexByName is actually returning a value.
     
    Last edited: May 2, 2013
  14. MrBoolean

    MrBoolean

    Joined:
    Jan 7, 2012
    Posts:
    197
    Hey, how can apply ex2D to the Unity 3D 2D gameplay tutorial?
     
  15. mntrskl

    mntrskl

    Joined:
    May 2, 2013
    Posts:
    1
    Hey Wu Jie!
    I was wondering if i could get some help with this next issue or at least learn if it's related to ex2D or not.

    The thing is I am developing a game using two terminals (one PC the other a MAC) and to synchronizr my work i'm using a GIT repository, the issue i'm having is that whenever i push my project from either one of my terminal i end up having to re-do all the Atlases and SpriteAnimations in the terminal who pulls the project. Since idk if this is some issue with ex2D itself or just Unity being a bastard i was hoping to learn something extra from the most experienced guys around!

    The plugin works great while working on a single terminal and it really makes my job handling sprites way easier so thanks in adv!
     
  16. juaduve

    juaduve

    Joined:
    May 1, 2013
    Posts:
    2
    Hi i am trying to learn some unity and i started with your plugin, but i cant animate on collision, here is my code (script linked to ball, want to animate "ladrillo", gameobject collisioned, think on arkanoid game):
    SpriteAnimado is linked to LadrilloAnimado.

    If I select Play automatically the animations do it fine, but i want to animate on collision with my ball. Can you help me? thanks in advance.
     
  17. juaduve

    juaduve

    Joined:
    May 1, 2013
    Posts:
    2
    Now it runs fine, at last it animate on collision, here is my code:

    now i need destroy object after animation lenght, lets see if i can do it :)
     
    Last edited: May 3, 2013
  18. Gnimmel

    Gnimmel

    Joined:
    Apr 21, 2010
    Posts:
    358
    I've just been banging my head against the wall for a few days trying to work out why I couldn't use .SetSprite and I've finally found the problem which seems to be a bug.

    I'm working on a ARPG IOS game and I'm using ex2D for some small sprite effects like flames etc. but mainly I'm using it for my menu's and my GUI. I have an older prototype in my signature below which worked great, but it was because it was just a prototype with a lot of spaghetti programming etc. Now I'm working on making it more structured and I found I couldn't update a sprite texture if the object with the script had been disabled and then enabled again using .SetActive.

    Basically I have an object which has 30 children, all ex2D sprites, which I'm updating with .SetSprite. These objects are icons for my inventory so I disable it with .SetActive(false) when it's not displayed. When I set the inventory active again, no matter what I do .SetSprite refuses to do anything. I get no errors or anything, I just call SetSprite and nothing happens.

    If I put the script which controls the ex2D sprites on a parent object which isn't ever disabled, everything works fine. I would like to find a work around for this, any thoughts?
     
  19. douglassophies

    douglassophies

    Joined:
    Jun 17, 2012
    Posts:
    141
    I am having a strange issue with exSpriteFont.text updating in the inspector during play mode, but not displaying on screen until i force it to refresh by changing something in the inspector.
    For an exact breakdown of the problem:
    During edit mode i set exSpriteFont.text to "default".
    During play mode the code sets it to "Hello".
    Then the code should change it to "Goodbye" but it remains as "Hello". When i click on the object in the inspector as the game is running, i can see that it is set to "Goodbye". If i make any changes to the inspector it will update immediately and display "Goodbye" correctly.
    I even tried putting a change to the exSpriteFont object in the Update() just to force it to change but it only seems to work if i change something through the inspector.
    Anyone got any suggestions? I am out of ideas now.
     
  20. Gnimmel

    Gnimmel

    Joined:
    Apr 21, 2010
    Posts:
    358
    @douglassophies this sounds very similar to my problem, updating something that doesn't update on screen.

    I just tried a test project to try and replicate my problem in a small scene I could send someone and of course everything worked fine. I'll be looking at it again a little latter to try and work out the difference in the working and non working version.
     
  21. Gnimmel

    Gnimmel

    Joined:
    Apr 21, 2010
    Posts:
    358
    @douglassophies I have no idea if this is your problem or not, but I finally worked out mine. I have 2 cameras in the scene, my main camera and my camera that points at all the ex2D sprites I'm using for my inventory. I was switching between the two by using SetActive on the camera's, but it seems this isn't the way to do it and after switching this to use the depth value instead, everything is working my end.
     
  22. douglassophies

    douglassophies

    Joined:
    Jun 17, 2012
    Posts:
    141
    @Gnimmel Thanks for the reply. I also had cameras that i was enabling and disabling but unfortunately switching to depth did not work for me. I will keep looking and get back if i find the issue.
    Edit: It was the cameras. I had not defined one for the ExSpriteFont in the inspector so it was picking one at default that was then being deleted causing it to default to a new one. Setting it to the new one from the start solved the issue. Could not have got there without your hint. Thanks so much.
     
    Last edited: May 8, 2013
  23. AntLewis

    AntLewis

    Joined:
    Feb 2, 2010
    Posts:
    254
    Hi, I've a problem with my orthogonal camera and ex2D (not sure which is at fault). I'm putting a 960x640 texture in the world (an ex2D sprite), clicking pixel perfect and framing my orthographic camera around it . But now every time I click off the camera and onto another game object and then back on the camera, the frustrum illustrating what the camera will display no longer frames the whole 960x640 texture (it’s reduced in size). So I have to increase the orthogonal size to frame the texture again....but repeat the process and it shrinks again! Argh! ANy ideas what this could be?

    Thanks
     
  24. vpin

    vpin

    Joined:
    Mar 15, 2012
    Posts:
    19
    Hi, Jwu

    project is dead?
     
  25. Wild-Factor

    Wild-Factor

    Joined:
    Oct 11, 2010
    Posts:
    607
    Same question.
     
  26. Fliperamma

    Fliperamma

    Joined:
    Apr 24, 2012
    Posts:
    31
    Hi guys, it seems that Jwu isn't replying answers for some time now, I hope he's ok.

    I don't have much expertise in Unity or iOS development yet so maybe you guys can help me out:
    I'm developing a game using ex2D and Unity 4.1 for iOS and I'm trying to get the file size down to 50 MB so I can get OTA transfers but the Xcode "estimate size" show something around 130 MB (I don't know if this can be used to measure the Store build size).
    Do you guys have some "magic" solution for this? I'm already using the PVRTC compression in almost all atlas and this actually make some sprites and animations look crappy.

    I have more couple questions that I don't know if are stupid ones, if they are, I apologize for that :neutral:

    - When packing my project to the Store do I need to delete the individual Textures used in the Atlas and keep only the Atlas bitmaps generated by ex2D? (I'm thinking if this will make some difference in the final file size)

    - My enemies prefabs are loaded from the Resources folder, I also keep my enemy Atlas there, is this the correct way to do it? (I was thinking that this will benefit the memory management / GC when loading and unloading assets )

    - I noticed that if you change directly a transform Scale instead of changing the Scale in ex2D Sprite you will get more Draw Calls so I developed a class that animate the ex2D Sprite Scale instead. This animations are like a Blob effect and I can do this with frame by frame but this will make the file size even bigger because I'll need at least one more Atlas ... Do you guys know if the performance using a script with Mathf.sin / cos to make the Blob effect will be more expensive than doing the Sprite frame by frame animations?
     
  27. Wild-Factor

    Wild-Factor

    Joined:
    Oct 11, 2010
    Posts:
    607
    Xcode estimated size is an estimate. Usually higher than what you get but for me ii was just for one or two Mo higher than the final size.
    I think there is a cheap plugin on the asset store that display the size for each type of your asset (uncompressed). This can help you optimize.

    - If there is no link to your origninal texture and if they are not in the resource folder, the build won't include it. It will include only your atlas texture. So no need to delete your original texture in theory. (but you can verify it easily)

    - I don't think you need to include your prefab in the ressource folder if they are not loaded from a path in your code. If you have GameObject with a public var referencing this prefab, it will include it.
    But if you load it from your code, from a path, you need to put it in the resource folder (Unity can't guess that you load it from your code).
    If you don't instanciate this prefab, resource (prefab texture) shouldn't be loaded.

    - Making an animation by code is most of the time a better solution. Unless you have hundreds of spritesanimated at the same time, and if you have plenty of memory.
    Old tricks: You can memorised cos an sin result in an array. (an array of size 360 for example)



    Tips:
    - Also look at your sound files.
    - Choose a non alpha texture type when you don't have Alpha.
    - Everything in your ressource folder will be in your build, linked to your scene or not.
    - The expensif Unity ios pro let you get few Mo more by removing unecessary code.
     
  28. Fliperamma

    Fliperamma

    Joined:
    Apr 24, 2012
    Posts:
    31
    Thank you very much for such a detailed answer.

    Best,

    Fabio
     
  29. harlock1975

    harlock1975

    Joined:
    Feb 27, 2012
    Posts:
    46
    Hi everybody,
    do any of you know how can I use a perspective camera with ex2d?
    If I switch to perspective camera my sprites turn all black, if I try to change the sprite shader (e.g. to transparent/diffuse) Unity complains "Shader wants tangents, but the mesh doesn't have them"
    Any suggestion?
    Thanks!

    EDIT: actually transparent/diffuse give me grey sprites, while others (like bumped diffuse) complain. Am I missing normals or something else???
     
    Last edited: May 26, 2013
  30. MrBoolean

    MrBoolean

    Joined:
    Jan 7, 2012
    Posts:
    197
    hi guys I want to learn 2D programming with EX2D, so how can I learn to script in 2D with Unity and EX2D?
     
  31. Fliperamma

    Fliperamma

    Joined:
    Apr 24, 2012
    Posts:
    31
    Hi Harlock1975, have tried to use the ex2D / Alpha Blended Shader? Also you can check if your Sprite is facing the correct direction, maybe it's inverted.
     
  32. harlock1975

    harlock1975

    Joined:
    Feb 27, 2012
    Posts:
    46
    Nice try Fliperamma, but no luck :(
    the ex2d shader is the default one and the result is black. I also tried mirroring the sprites (with h-flip) and turning them 180 degrees without success.
    Any more ideas?
     
  33. paraself

    paraself

    Joined:
    Jun 30, 2012
    Posts:
    139
    Hi Guys I contacted jwu personally and he's extremely busy on launching his new game. He said he'll be back on ex2d 2.0 once the game is done. We just need a little patience...
     
  34. radnetro

    radnetro

    Joined:
    Apr 30, 2013
    Posts:
    6
    I am creating a game sort of Ragnarok Style where character is in 2D and everything else in 3d. But I'm having a problem with the dynamic shadow for the 2d item. Can the directional light cast a shadow on ex2D sprite?
     
  35. maleone0487

    maleone0487

    Joined:
    Feb 23, 2011
    Posts:
    59
    I've whipped up a quick script for word wrapping with exSprite Fonts. It doesn't scale the text when it looks like it will spill over the bounds, instead it throws a warning. This is due to a particular requirement of the game I'm working on (we don't want text to scale) but that could be added easily. Feel free to use this script as you need in your projects.

    Just a quick note, i'm still working with Unity 3.5, so I'm not sure if this will need to be adapted at all for Unity 4 and up.

    To use the script, just supply an exSpriteFont (should be on the same object), then call SetText(string aText) instead of directly setting the text.

    Code (csharp):
    1.  
    2. public class exSpriteFontLayout: MonoBehaviour
    3. {
    4.     public exSpriteFont SpriteFont = null;
    5.     public float MaxWidth = 400f;
    6.     public float MaxHeight = 150f;
    7.  
    8.     private void Start()
    9.     {
    10.         if (SpriteFont == null)
    11.         {
    12.             SpriteFont = GetComponent<exSpriteFont>();
    13.         }
    14.  
    15.         if (!SpriteFont.useMultiline)
    16.         {
    17.             SpriteFont.useMultiline = true;
    18.         }
    19.  
    20.         // Uncomment this line to make sure it works!
    21.         //SetText("This is a whole bunch of Text! Lets hope it wraps correctly.");
    22.     }
    23.  
    24.     public void SetText(string aText)
    25.     {
    26.         // Assign the text to the sprite font and commit (force the mesh to update)
    27.         SpriteFont.text = aText;
    28.         SpriteFont.Commit();
    29.  
    30.         // the width of the current line
    31.         float lineWidth = 0;
    32.         // the index of the current character within the entire string
    33.         int charIndex = 0;
    34.         // the text that currently fits inside the line
    35.         string currentLine = string.Empty;
    36.  
    37.         // all the words in the text
    38.         string[] words = aText.Split(' ');
    39.  
    40.         // used to construct the final string
    41.         List<string> lines = new List<string>();
    42.  
    43.         for (int i = 0; i < words.Length; i++)
    44.         {
    45.             string currentWord = words[i];
    46.             float wordWidth = 0;
    47.  
    48.             // add a space if this is not the last word, to account for
    49.             // the space in the mesh
    50.             if (i < words.Length - 1)
    51.             {
    52.                 currentWord += " ";
    53.             }
    54.  
    55.             // get the width of the word
    56.             for (int j = 0; j < currentWord.Length; j++)
    57.             {
    58.                 wordWidth += SpriteFont.GetCharRect(charIndex).width;
    59.                 // this index tracks relative to the entire text input
    60.                 charIndex++;
    61.             }
    62.  
    63.             // If this is true, we need to wrap the current string from the previous word
    64.             if (lineWidth + wordWidth > MaxWidth)
    65.             {
    66.                 lines.Add(currentLine);
    67.                 currentLine = string.Empty;
    68.                 lineWidth = 0;
    69.             }
    70.  
    71.             currentLine += currentWord;
    72.             lineWidth += wordWidth;
    73.  
    74.             if (i == words.Length - 1)
    75.             {
    76.                 lines.Add(currentLine);
    77.             }
    78.         }
    79.  
    80.         // construct the final text
    81.         string finalText = string.Empty;
    82.         for (int i = 0; i < lines.Count; i++)
    83.         {
    84.             string line = (i == lines.Count - 1) ? lines[i] : lines[i] + "\n";
    85.             finalText += line;
    86.         }
    87.  
    88.         // This is just a warning to indicate the text will spill out of the given region
    89.         float totalTextHeight = (lines.Count * SpriteFont.fontInfo.lineHeight) + SpriteFont.lineSpacing;
    90.         if (totalTextHeight > MaxHeight)
    91.         {
    92.             Debug.LogWarning("There are too many lines in this text, it will spill out!");
    93.         }
    94.  
    95.         // submit the final text and commit it
    96.         SpriteFont.text = finalText;
    97.         SpriteFont.Commit();
    98.     }
    99.  
    100.     private void OnDrawGizmos()
    101.     {
    102.         if (SpriteFont == null)
    103.         {
    104.             return;
    105.         }
    106.  
    107.         Vector3 upLeft = transform.position;
    108.         Vector3 upRight = transform.position;
    109.         Vector3 downLeft = transform.position;
    110.         Vector3 downRight = transform.position;
    111.  
    112.         float halfWidth = MaxWidth /2;
    113.         float halfHeight = MaxHeight / 2;
    114.  
    115.         switch (SpriteFont.anchor)
    116.         {
    117.             case exPlane.Anchor.BotCenter:
    118.                 upLeft += new Vector3(-halfWidth, MaxHeight);
    119.                 upRight += new Vector3(halfWidth, MaxHeight);
    120.                 downLeft.x -= halfWidth;
    121.                 downRight.x += halfWidth;
    122.                 break;
    123.             case exPlane.Anchor.BotLeft:
    124.                 upLeft.y += MaxHeight;
    125.                 upRight += new Vector3(MaxWidth, MaxHeight);
    126.                 downRight.x += MaxWidth;
    127.                 break;
    128.             case exPlane.Anchor.BotRight:
    129.                 upLeft += new Vector3(-MaxWidth, MaxHeight);
    130.                 upRight.y += MaxHeight;
    131.                 downLeft.x -= MaxWidth;
    132.                 break;
    133.             case exPlane.Anchor.MidCenter:
    134.                 upLeft += new Vector3(-halfWidth, halfHeight);
    135.                 upRight += new Vector3(halfWidth, halfHeight);
    136.                 downLeft -= new Vector3(halfWidth, halfHeight);
    137.                 downRight += new Vector3(halfWidth, -halfHeight);
    138.                 break;
    139.             case exPlane.Anchor.MidLeft:
    140.                 upLeft.y += halfHeight;
    141.                 upRight += new Vector3(MaxWidth, halfHeight);
    142.                 downLeft.y -= halfHeight;
    143.                 downRight += new Vector3(MaxWidth, -halfHeight);
    144.                 break;
    145.             case exPlane.Anchor.MidRight:
    146.                 upLeft += new Vector3(-MaxWidth, halfHeight);
    147.                 upRight.y += halfHeight;
    148.                 downLeft -= new Vector3(MaxWidth, halfHeight);
    149.                 downRight.y -= halfHeight;
    150.                 break;
    151.             case exPlane.Anchor.TopCenter:
    152.                 upLeft.x -= halfWidth;
    153.                 upRight.x += halfWidth;
    154.                 downLeft -= new Vector3(halfWidth, MaxHeight);
    155.                 downRight += new Vector3(halfWidth, -MaxHeight);
    156.                 break;
    157.             case exPlane.Anchor.TopLeft:
    158.                 upRight += new Vector3(MaxWidth, 0);
    159.                 downRight += new Vector3(MaxWidth, -MaxHeight);
    160.                 downLeft -= new Vector3(0, MaxHeight);
    161.                 break;
    162.             case exPlane.Anchor.TopRight:
    163.                 upLeft.x -= MaxWidth;
    164.                 downLeft -= new Vector3(MaxWidth, MaxHeight);
    165.                 downRight.y -= MaxHeight;
    166.                 break;
    167.             default:
    168.                 break;
    169.         }
    170.  
    171.         Gizmos.color = Color.cyan;
    172.         Gizmos.DrawLine(upLeft, upRight);
    173.         Gizmos.DrawLine(upRight, downRight);
    174.         Gizmos.DrawLine(downRight, downLeft);
    175.         Gizmos.DrawLine(downLeft, upLeft);
    176.     }
    177. }
    178.  
     
    Last edited: May 29, 2013
  36. Fliperamma

    Fliperamma

    Joined:
    Apr 24, 2012
    Posts:
    31
    Hi Harlock, are you using Layers? Maybe your perspective camera doesn't have the correct Layer checked at the Culling Mask.
     
  37. harlock1975

    harlock1975

    Joined:
    Feb 27, 2012
    Posts:
    46
    Yes I am using layers but they look correctly set up. I have two cameras, one orthographic and the other one perspective. The sprites on the perspective one are entirely drawn black.
    I tried a new project, and it worked, so I should have messed something in my project, but I can't understand what!
    Thanks for your help
     
  38. Chaosgod_Esper

    Chaosgod_Esper

    Joined:
    Oct 25, 2012
    Posts:
    295
    Hi
    i bought eX2D pro.. and got a probem with the Sprite Animation Editor. All Animatikns are automatically named as "new Sprite Animation(XXX)".. I didn´t get a window where i can give the Animation a name or something like that.. All i can do is.. rename them via the Explorer..

    Isn´t there a Ex2D intern way to give Animations a Name?
     
  39. harlock1975

    harlock1975

    Joined:
    Feb 27, 2012
    Posts:
    46
    You should be able to rename any item in the Project pane, by hitting F2 or by right-clicking and selecting Rename.
     
  40. bellotje

    bellotje

    Joined:
    Apr 23, 2013
    Posts:
    4
    Hi all,

    I have a question regarding the use of atlasses.
    Is it possible to exclude at build time, all assets which are included in an atlas ?
    I read that unity automatically excludes unused assets but what about textures that are put together in an atlas ? Are they considered as unused ?

    This to reduce the size of my application..
     
  41. Matevzg

    Matevzg

    Joined:
    Jun 17, 2013
    Posts:
    1
    I have a problem with EventInfo in Sprite Animation. I would like to know if anybody already came accross it and if there exists a solution for it?

    I created blank Sprite Animation object. Then I added some frames to it. At the first frame I created new Animation Event. I want to call a method with GameObject parameter from this event. Method header looks like: public void MyMethod(GameObject obj);
    So in the event info I wrote MyMethod as method name and selected Object as param type. Then I choose my game object which I want to include as a parameter. The problem is that reference to this game object dissapears every time I close Unity. When I select game object and run the game everything works normally. Then I close and reopen Unity and my game object is no longer set in animation event. It just resets the parameter and sets it to None.

    Am I doing something wrong or is it true that animation events with Object parameter don't remember the settings when you close the project? I use other events with string parameters and they work OK. I only have problems if param type is Object.
     
  42. Vahia

    Vahia

    Joined:
    Dec 4, 2012
    Posts:
    2
    Hi, I would like to use multi-line of ex sprite font, but i want to use it in script. I tried this.

    MyExSprite.text = "Question " +
    "" + NumQuestion + "/" + _TABQuestion.Length;

    Expectation:
    Question
    1/10

    Reality:
    Question 1/10

    Multi-line is activated on script

    It is possible to use ex2d multi-line in script ?
     
    Last edited: Jun 18, 2013
  43. Dan Fury

    Dan Fury

    Joined:
    Jul 18, 2010
    Posts:
    158
    Hi Wu Jie,
    I'm working on a new project where I'm using ex2D. Any news about your tile map editor?
     
  44. harlock1975

    harlock1975

    Joined:
    Feb 27, 2012
    Posts:
    46
    Didn't try this, but usually you should place a \n as a newline in a string (so "Question\n"+...). I guess ex2d is no exception.
     
  45. maleone0487

    maleone0487

    Joined:
    Feb 23, 2011
    Posts:
    59
    @Vahia

    Check back a page or two in the thread, I posted a sprint font word wrapping utility you can use to get this effect a bit easier. Harlock's solution will work as well though
     
  46. Vahia

    Vahia

    Joined:
    Dec 4, 2012
    Posts:
    2
    Thanks for these answers it helped me a lot !

    A new problem appeared when I built for Android, all my SpriteFont I updated in script lose their accent and some weird caracter appeared (? #), I searched and tried some solution (recreate an AtlasFont / BitmapFont, save in Unicode / UTF8 ). It does the same thing when I copy my project and open it on a MAC (on this Mac other text with an other AtlasFont modify in script works).
    Maybe this problem is MonoDevelop encoding ? Is that possible ?

    Infos: Font: ShortStack Regular.
     
    Last edited: Jul 10, 2013
  47. Harter

    Harter

    Joined:
    Feb 28, 2012
    Posts:
    119
  48. CodeFighter

    CodeFighter

    Joined:
    Dec 15, 2012
    Posts:
    63
    Hello guys! Can I ask something? I need get a texture of sprite for my editor window. How can I get texture of sprite not an atlas. I think I must use exSprite class but I cant see texture there. Can you help me? thank you!
     
  49. johnny_karas

    johnny_karas

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

    Just back from ex2D project. I'm here to say sorry that I'm Super Busy in the last year, and that make me developed slow event stop ex2D project for a long time. The good news is I'm back to the project and I'm happy to announced ex2D v2.0 after all. I hope you can understand.

    The ex2D v2.0 is in beta-test state, we will open the site, sending the beta test package and collect feedback in the next few days. For people who already bought ex2D v1.+, it is Free upgrade to v2.0. But remember ex2D v2.0 is totally re-design for the working pipeline and data structure, so it is NOT compatible with the ex2D v1.+ projects.

    The biggest difference between ex2D v2.0 and older version is the changes of the rendering pipeline. We are working hard to optimise sprite rendering, instead of using Unity's dynamic batching method, we are making the sprites batch together in one mesh at the beginning, and dynamically combining meshes when sprite changes. It is proved in this way, we are 10%-30% faster compare to other 2D framework/plugins in both PC and mobile devices.

    In the mean time, we re-design the working pipeline and editor for making sprite assets. We temporarily remove the auto-detect and sync method from texture to atlas. It prevent people suffer out of memory problem in huge project. Instead, we are planing adding manually and automatically update in each asset generator/editor. We also rewrite most editor to support lots of small new feature such as group editing, rotated atlas texture element, ...

    Another new feature is a 2D scene editor we wrote start from scratch. The scene editor is managed to make editing 2D scene easier compare to directly editing sprites in Unity's Scene View window. The editor support layers to put sprite ( Yes, like what you do in Photoshop ), rotate, resize what ever you can image to editing 2D element in a fashion editor. In the future it will support Tile-map editing and sprite alignment.

    I post this thread to thank you for supporting ex2D v1.+ and to make people understand my state last year. We will start up beta test very soon, so if you have any question about ex2D v2.0 project, try to contact us through EMail: support@ex-dev.com
     
  50. toto2003

    toto2003

    Joined:
    Sep 22, 2010
    Posts:
    528
    awesome, thanks wu jie, it s nice you re back into this even you ve been super busy, looking forward and test your new version !