Unity Community


Page 61 of 89 FirstFirst ... 1151596061626371 ... LastLast
Results 1,201 to 1,220 of 1772

  1. Posts
    5
    Hi

    I'm trying to figure out how i can change, by script, texture image used in a exsprite object.
    I can use (SetSprite(Atlas, index, false), but it's not really interesting because everytime i add new texture in my atlas and rebuild it, the texture's index change.

    How can do that?
    Thank you!


  2. Posts
    5
    Quote Originally Posted by Bertrand07 View Post
    Hi

    I'm trying to figure out how i can change, by script, texture image used in a exsprite object.
    I can use (SetSprite(Atlas, index, false), but it's not really interesting because everytime i add new texture in my atlas and rebuild it, the texture's index change.

    How can do that?
    Thank you!
    Or i can use "exSpriteAnimation.setFrame".
    But i don't know if it's the better solution...


  3. Location
    Italy
    Posts
    217
    Quote Originally Posted by Bertrand07 View Post
    Hi

    I'm trying to figure out how i can change, by script, texture image used in a exsprite object.
    I can use (SetSprite(Atlas, index, false), but it's not really interesting because everytime i add new texture in my atlas and rebuild it, the texture's index change.

    How can do that?
    Thank you!
    At runtime, you can get the sprite ID calling this method:
    atlas.GetIndexByName(textureName);


  4. Posts
    84
    Ex2D text often seems to have random jitter on the y position of each character. Is this a known issue? Any fix for it?


  5. Posts
    5
    Quote Originally Posted by simone007 View Post
    At runtime, you can get the sprite ID calling this method:
    atlas.GetIndexByName(textureName);
    Cool
    Thank you!

  6. Super Moderator
    Location
    USA - Chesaning, MI
    Posts
    1,513
    Quote Originally Posted by jwu View Post
    Hi Thomas Pasieka,

    This is a known issue in ex2D v1.+. When you update the atlas, ex2D can only rebuild the atlas and rebuild the scene sprites for current opening scene. When you change the scene to other one, you have to run Edit/ex2D/Rebuild Scene Sprites from the main menu first to correct the scene. Also, if you make sprite to prefab, you'd better run Edit/ex2D/Rebuild Prefabs so that the prefab will update to the new atlas.

    We find this problem can be solved if the item of the scene is using prefab instead. But the key to solve the problem is change some of the structure in ex2D, that is exactly what I'm trying to do right now in ex2D v2.0.

    Let me know if my suggestion fix it temporary.

    Hey there Wu,

    That does help a little bit but it's still time consuming and annoying. When is v2.0 supposed to go live?

    Thomas P.
    I am available for Freelance work! Contact me via PM or email.
    My blog: Click to open
    Twitter: Thomas Pasieka


  7. Posts
    704
    Quote Originally Posted by robin_notts View Post
    Ex2D text often seems to have random jitter on the y position of each character. Is this a known issue? Any fix for it?
    Hi robin_notts,

    Can you explain more about this, I'm curious and will check it.


  8. Posts
    704
    Quote Originally Posted by Thomas Pasieka View Post
    Hey there Wu,

    That does help a little bit but it's still time consuming and annoying. When is v2.0 supposed to go live?

    Thomas P.
    Hi Thomas,

    I plan to release it at September this year. The ex2D v2.0 changes a lot so it is not compatible with v1.0, after the first version finished, I'll write upgrade script so that people in v1.+ can convert their project to v2.0. But it won't be that easy so safely upgrading is not sure yet.

    I know this is a pain and make user frustrate, that's why I'm changes a lot in v2.0 which cost me much more workload. Before it comes out, let me give you some suggestion that we did in our project:

    1. Don't change one atlas at the same time for two or more peoples. This will cause the _ex2D_AtlasDB and _ex2D_SpriteAnimationDB file corrupt.
    2. Let only one person managing the atlas, the other artist just contribute raw pictures/textures.
    3. Keep in mind to rebuild scene and prefabs when atlas changed ( if only one person manage this, he can in charge of updating the scene )
    4. Don't ignore importing error when drag texture to atlas or sync from server triggered an atlas rebuild.

    Before v2.0 comes out, I think I can do a little change to help multiple people working together ----- change the _ex2D_AtlasDB and _ex2D_SpriteAnimationDB from ScriptableObject (binary) to xml file. This can prevent errors when more than one people changes atlas at the same time and put them into CVS server. I will start this at weekend, probably finished it by one to two days.


  9. Posts
    4

    Please teach me about ex2D functions.

    Hello,
    I'm shinichi .
    Sorry, I don't speak english well.
    if I have mis ,sorry.

    I am using the ex2D now.
    And, I'm making the program by only C# and only class in library.

    I want to make the picture for sprite that I put the pictures on screen by class functions.
    I read api documents.
    And , I found the exBitmapFontUtility.Create.
    However, The Unity compiler generate the error that is "not found the class of exBitmapFontUtility".
    I can use the class of "exBitmapFont".
    However ,I coudn't use the class of "exBitmapFontUtility".

    What should I set the anything?
    If possible,please teach me these informations.

    Best regards.

  10. Super Moderator
    Location
    USA - Chesaning, MI
    Posts
    1,513
    Quote Originally Posted by jwu View Post
    Hi Thomas,

    Before v2.0 comes out, I think I can do a little change to help multiple people working together ----- change the _ex2D_AtlasDB and _ex2D_SpriteAnimationDB from ScriptableObject (binary) to xml file. This can prevent errors when more than one people changes atlas at the same time and put them into CVS server. I will start this at weekend, probably finished it by one to two days.
    September release is too late for us. We need something that works now. ex2D NEEDS to work in a "Team" environment otherwise it's useless. Sorry to sound harsh but that's the reality. So please, look into changing it from Binary to XML and pray that it works. I would hate to have 30 levels at one point and continuously have to rebuild levels just because somebody added or rebuild an atlas. I am not happy at the moment.

    Thomas P.
    I am available for Freelance work! Contact me via PM or email.
    My blog: Click to open
    Twitter: Thomas Pasieka


  11. Posts
    6
    Hello, I have ran into a problem which I cant solve but I guess the answer is really simple...

    I worked quite a bit with ex2D already and its great, one thing when I add new sprites for example I create an empty game object, attach exSprite component to it and then add the texture ( by drag and drop ) I see the texture rendered by my camera in game view and I see it in scene view. Now how could I accomplish this through code? Basically I am trying to have an empty game object with exSprite attached to it and no texture, then I generate the texture programmatically and now I want to set the exSprite texture on that game object to my generated Texture2D.

    Here is an example on how I could do it not using ex2D:

    Code:  
    1. Texture2D Terrain = new Texture2D(128, 128);
    2.         renderer.material.mainTexture = Terrain;
    3.      
    4.         for (int i = 0; i < Terrain.height; i++)
    5.         {
    6.             for (int j = 0; j < Terrain.width; j++)
    7.             {
    8.                 Terrain.SetPixel(i, j, Color.cyan);
    9.             }
    10.         }
    11.  
    12.         // Apply all SetPixel calls
    13.         Terrain.Apply();
    14.         guiTexture.texture = Terrain; // <-- exSprite here

    Now I tried so far to get the ex2D exSprite component from my game object through code and this worked well ( for instance)
    Code:  
    1. exSprite Sprite = gameObject.GetComponent<exSprite>();
    but I couldn't figure out how to change the texture now ... something like Sprite.Texture = .. I couldn't find.

    Hope that I explained it well, if not feel free to ask any questions.

    Thanks in Regards ~Froobzi

  12. Super Moderator
    Location
    Great Britain
    Posts
    9,640
    Using exSpriteText, if it is a child and offscreen when updating the text, it throws

    IndexOutOfRangeException: Array index is out of range.
    Currently working with Sony on our new
    PS4 and Vita game in Unity!

    This post is not representative of Simian Squared Ltd


  13. Posts
    704
    Quote Originally Posted by Sinichi View Post
    Hello,
    I'm shinichi .
    Sorry, I don't speak english well.
    if I have mis ,sorry.

    I am using the ex2D now.
    And, I'm making the program by only C# and only class in library.

    I want to make the picture for sprite that I put the pictures on screen by class functions.
    I read api documents.
    And , I found the exBitmapFontUtility.Create.
    However, The Unity compiler generate the error that is "not found the class of exBitmapFontUtility".
    I can use the class of "exBitmapFont".
    However ,I coudn't use the class of "exBitmapFontUtility".

    What should I set the anything?
    If possible,please teach me these informations.

    Best regards.
    Hello Sinichi,

    The exBitmapFontUtility is an Editor script. Which means you can not use this script in the runtime. If you want to reference the script, you need to put your script in an Editor/ folder so that Unity can help you import those editor script correctly.

    Regards,
    Wu


  14. Posts
    704
    Quote Originally Posted by Thomas Pasieka View Post
    September release is too late for us. We need something that works now. ex2D NEEDS to work in a "Team" environment otherwise it's useless. Sorry to sound harsh but that's the reality. So please, look into changing it from Binary to XML and pray that it works. I would hate to have 30 levels at one point and continuously have to rebuild levels just because somebody added or rebuild an atlas. I am not happy at the moment.

    Thomas P.
    Hello Thomas,

    After several test, I found XML file didn't solve your problem. The way to solve this problem can only be done in ex2D v2.0. However, to make people including me ease the work in ex2D v1.+, I wrote a script, which will loop the scenes you selected, and rebuild the sprites automatically in these scenes. Here is the picture to illustrate how to use it:

    When some one in the team build the sprite and found it corrupt the scene, he can run this script to easily rebuild all the exits scene.

    This change can be available in the later daily fix version (1.2.6 120602).
    Attached Images  


  15. Posts
    704
    Quote Originally Posted by Froobzi View Post
    Hello, I have ran into a problem which I cant solve but I guess the answer is really simple...

    I worked quite a bit with ex2D already and its great, one thing when I add new sprites for example I create an empty game object, attach exSprite component to it and then add the texture ( by drag and drop ) I see the texture rendered by my camera in game view and I see it in scene view. Now how could I accomplish this through code? Basically I am trying to have an empty game object with exSprite attached to it and no texture, then I generate the texture programmatically and now I want to set the exSprite texture on that game object to my generated Texture2D.

    Here is an example on how I could do it not using ex2D:

    Code:  
    1. Texture2D Terrain = new Texture2D(128, 128);
    2.         renderer.material.mainTexture = Terrain;
    3.      
    4.         for (int i = 0; i < Terrain.height; i++)
    5.         {
    6.             for (int j = 0; j < Terrain.width; j++)
    7.             {
    8.                 Terrain.SetPixel(i, j, Color.cyan);
    9.             }
    10.         }
    11.  
    12.         // Apply all SetPixel calls
    13.         Terrain.Apply();
    14.         guiTexture.texture = Terrain; // <-- exSprite here

    Now I tried so far to get the ex2D exSprite component from my game object through code and this worked well ( for instance)
    Code:  
    1. exSprite Sprite = gameObject.GetComponent<exSprite>();
    but I couldn't figure out how to change the texture now ... something like Sprite.Texture = .. I couldn't find.

    Hope that I explained it well, if not feel free to ask any questions.

    Thanks in Regards ~Froobzi
    Hello Froobzi,

    Here is the documentation to show you how to change sprite by texture : http://www.ex-dev.com/ex2d/wiki/doku...ite_by_texture

    Remember, this method only works in Editor, cause all the function here are Editor Only. In the runtime, ex2D don't even know you have a texture.


  16. Posts
    704
    Quote Originally Posted by hippocoder View Post
    Using exSpriteText, if it is a child and offscreen when updating the text, it throws

    IndexOutOfRangeException: Array index is out of range.
    I will check this, and update this post. Keep in touch.

    Update:

    Hi hippocoder, I've check it but nothing happend. Can you send me an example including this issue? Thanks in advance.
    Last edited by jwu; 06-02-2012 at 03:14 AM.


  17. Posts
    6
    Quote Originally Posted by jwu View Post
    Hello Froobzi,

    Here is the documentation to show you how to change sprite by texture : http://www.ex-dev.com/ex2d/wiki/doku...ite_by_texture

    Remember, this method only works in Editor, cause all the function here are Editor Only. In the runtime, ex2D don't even know you have a texture.
    Thanks a lot for the reply, I managed to fix it thanks to you!

  18. Super Moderator
    Location
    Great Britain
    Posts
    9,640
    Quote Originally Posted by jwu View Post
    I will check this, and update this post. Keep in touch.

    Update:

    Hi hippocoder, I've check it but nothing happend. Can you send me an example including this issue? Thanks in advance.
    I can't, I don't have authorization. I wonder why this happens? And why should it stop when moving back on screen. Perhaps a unity bug? I don't know.
    Currently working with Sony on our new
    PS4 and Vita game in Unity!

    This post is not representative of Simian Squared Ltd


  19. Posts
    704
    Quote Originally Posted by hippocoder View Post
    I can't, I don't have authorization. I wonder why this happens? And why should it stop when moving back on screen. Perhaps a unity bug? I don't know.
    Can you create a simple scene that don't including any of your company resources for this problem ? I try it several times but still can't reproduce it.

    BTW: if you have trouble in creating such a scene, may be you can take some picture and instruction that help me create it step by step.

    Thanks in advance.


  20. Posts
    84
    Hi jwu. Sorry for the slow response. Hopefully you can see the issue about character vertical positioning from this image:

    It happens on all fonts. I'm really surprised no-one has flagged this up earlier.

Page 61 of 89 FirstFirst ... 1151596061626371 ... LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •