Unity Community


Page 52 of 126 FirstFirst ... 242505152535462102 ... LastLast
Results 1,021 to 1,040 of 2517

  1. Posts
    4
    You play animation from the begining while you holding down the left mouse button that's why you see the first frame.

    if(!anim.isPlaying || anim.CurrentClip.name != "High Acceleration 1")
    anim.Play("High Acceleration 1");


  2. Location
    Newcastle upon Tyne, UK
    Posts
    1,178
    Quote Originally Posted by Mikhail View Post
    Hi! I have a problem with my build. I create sprites and sprite animations with script and if I click play button in unity everything is ok. But then I build my project sprites and animations dont work. I try different ways to create
    GameObject go = new GameObject();
    tk2dSprite sprite = go.AddComponent<tk2dSprite>();
    sprite.SwitchCollectionAndSprite(data, 0);
    sprite.Build();

    I try to load collection from Resources, I try to instantiate from a prefab, and in game view everything is ok, but after building it doesnt work. Target platform is PC.

    How do you get data? Also, what file do you store in the resources folder?
    Last edited by unikron; 04-20-2012 at 02:16 AM.


  3. Location
    Newcastle upon Tyne, UK
    Posts
    1,178
    Quote Originally Posted by himatako View Post
    I think it happened to me as well. I was testing various 2d plugins the other day, and find out that the sprite created from toolkit2d is blurry unlike the others. At first I thought it's because of my raw asset files, so I change them to psd. Once switched to psd, the other plugins are noticeably sharper, while toolkit2d sprite was still blurry.
    Thanks for the source files to reproduce this - As explained in the email, this is caused by a discrepancy with the ortho size and the sprite position you picked, ended up not being on a pixel center.

    A simple solution to this is to use the tk2dCamera, where every round number in world space is guaranteed to be a pixel boundary.


  4. Posts
    4
    Quote Originally Posted by unikron View Post
    How do you get data? Also, what file do you store in the resources folder?
    I solved the problem. First of all I used sprite.spriteId = sprite.collection.GetSpriteIdByName("spriteName"); instead sprite.spriteId = sprite.GetSpriteIdByName("spriteName"); I have two prefabs for sprite and sprite animation and both of them for default used collection which not included in build thats why arisen exeption. I switch default collection and animation. Now everything fine. Thanks.
    P.S. I think it would be greate idea to make SpriteCollection without reference to source textures and work only with atlas. For example I have a huge number of images and when switch between platforms Unity crashes. I have to create new project for each platform and initialize animation and sprite collections from the begining.


  5. Location
    Newcastle upon Tyne, UK
    Posts
    1,178
    That is an interesting request, but a lot of the features would not be usable, which is why I haven't implemented it. One example is sprite dicing. I have had some need for this though, so I am considering it.

    I was thinking of some optimizations to make the SpriteCollection build require significantly less resources, and remove all references to the source textures themselves - would that help in your case?


  6. Posts
    165
    @unikron is there a way to avoid/hide the "divisions" shown of a sprite with dicing when scaling?


  7. Posts
    25
    Quote Originally Posted by unikron View Post
    Can you send a screenshot to support at unikronsoftware dot com demonstrating the problem please? Im not really sure what's going on.
    Thanks for your response.
    I apologize it was my problem. The images are actually rendered correctly as crosses (my sample placeholders) when they become small. Just because they are rendered as crosses I thought they rendered incorrectly.

    Is there any plan to add more features to the button class? e.g.
    - support Time.timeScale = 0
    - a method to change the shown image

    If you have no time doing so, I may help adding the second feature and releasing a modified one here. I don't know how to solve the first problem.
    Thanks very much for your time.


  8. Location
    Newcastle upon Tyne, UK
    Posts
    1,178
    When scaling up there should be no seams.

    When scaling down - you can get better results by increasing padding, or setting point filtering. Both can and will fail in various different ways, though.This is inevitable due to how graphics hardware works.Start with some really large padding amount and scale down from there to see what works best for you.


  9. Location
    Newcastle upon Tyne, UK
    Posts
    1,178
    Quote Originally Posted by mobilegamelabs View Post
    Thanks for your response.
    I apologize it was my problem. The images are actually rendered correctly as crosses (my sample placeholders) when they become small. Just because they are rendered as crosses I thought they rendered incorrectly.

    Is there any plan to add more features to the button class? e.g.
    - support Time.timeScale = 0
    - a method to change the shown image

    If you have no time doing so, I may help adding the second feature and releasing a modified one here. I don't know how to solve the first problem.
    Thanks very much for your time.
    Time.timeScale = 0, that will be fixed in the next release. Drop me an email at support at unikronsoftware dot com to get this script sooner if you want.

    with the second one, do you mean changing it from script?


  10. Location
    Toronto, Ontario
    Posts
    202
    Hi, I couldn't find anything in the docs about adding many fonts to a single Sprite Collection. After some trial and error, I came up with the following workflow. Does this sound correct? If so, please feel free to add these steps to the 2DTK docs.

    1. create a new Sprite Collection
    2. open the sprite collection editor
    3. click Create and then select Font
    4. drag the exported fonts .fnt file into the BM Font slot (note I made my font with Glyph designer)
    5. drag the exported fonts .png into the Font Texture slot*
    6. click the Create button in the area that says "A data object is required to build a font."
    7. select a folder for the .prefab
    8. click Commit in the Sprite Collector and now the font should be available on a Text Mesh.

    *Note at this point an additional field appeared in the Sprite Collector that says "the texture importer needs to be reconfigured to be used as a font texture source. Please not that this will globally change this texture importer" along with a button that says "Set up".
    Last edited by meanstreak; 04-21-2012 at 04:28 PM.


  11. Location
    Newcastle upon Tyne, UK
    Posts
    1,178
    Thats pretty much it - sorry about the lack of docs on that, its been one hectic month. Thanks for the steps, I'll get that added to the docs (and the other undocumented features) as soon as I can together with some screengrabs.

    Edit: did you have any trouble figuring it out? If so, where? I spent a great deal of time working out a clear workflow in the new sprite collection editor, and the idea is there shouldn't be many places things could go wrong, so if something wasn't clear, etc. please let me know so I'll know what to address.
    Last edited by unikron; 04-21-2012 at 04:58 PM.


  12. Location
    Toronto, Ontario
    Posts
    202
    Quote Originally Posted by unikron View Post
    Edit: did you have any trouble figuring it out? If so, where? I spent a great deal of time working out a clear workflow in the new sprite collection editor, and the idea is there shouldn't be many places things could go wrong, so if something wasn't clear, etc. please let me know so I'll know what to address.
    Yeah figuring out the correct order was a bit trial and error - like you have to click the Create button before you click the Commit button. First time I tried I did it the other way around which didn't work. On a side note I sometimes forget to press the Commit button at all because it's kind of small and not very obvious.

    I had originally made all my fonts using the old method and I tried to recreate them with the Sprite Collection editor but they weren't being created properly - everything looked fine with the files but the glyphs were solid white in the Atlas. So my workaround was to re-export from Glyph Designer and then make them fresh with the Sprite Collection editor.


  13. Location
    Newcastle upon Tyne, UK
    Posts
    1,178
    Good point about the create button - perhaps I should add some inline messagebox stating that it won't work until the object has been created. I'll get the docs done before revisiting this.

    Thanks for the feedback, its much appreciated.

    Did you get any messages in the console when the fonts ended up solid white? It could be because they weren't marked "Read/Write Enabled" - the "Set up" button sorts that out for you.
    Last edited by unikron; 04-21-2012 at 05:37 PM.


  14. Location
    Toronto, Ontario
    Posts
    202
    Quote Originally Posted by unikron View Post
    Did you get any messages in the console when the fonts ended up solid white? It could be because they weren't marked "Read/Write Enabled" - the "Set up" button sorts that out for you.
    I did get some messages in the console, but didn't copy them down. But now that you mention it, the "set up" button didn't appear in the cases where the font ended up being solid white. An easy test to reproduce on your end would be to make a font the old way, then delete the data and prefab files that get created with that process (since they get created again in the next step), and then try to add that same .fnt and .png to a sprite collection.


  15. Posts
    25
    Quote Originally Posted by unikron View Post
    Time.timeScale = 0, that will be fixed in the next release. Drop me an email at support at unikronsoftware dot com to get this script sooner if you want.

    with the second one, do you mean changing it from script?
    Thanks very much for your prompt reply and solving the problem.
    Yes, I mean changing from script. Moreover, I hope you will add a feature (add a few more public string variables for sprite names of a toggled state) to toggle the state of the button that, for example, when a "Pause" button is pressed (stays as pressed until clicked again), it's shown as "Play" and when it's released it's shown as "Pause", so that I don't need to change the shown image from script.

    Does global changing in Prefab not work (propagate) for the parameters in AnimatedSprite in Inspector?

    Thanks very much for your time!


  16. Location
    Newcastle upon Tyne, UK
    Posts
    1,178
    Quote Originally Posted by meanstreak View Post
    I did get some messages in the console, but didn't copy them down. But now that you mention it, the "set up" button didn't appear in the cases where the font ended up being solid white. An easy test to reproduce on your end would be to make a font the old way, then delete the data and prefab files that get created with that process (since they get created again in the next step), and then try to add that same .fnt and .png to a sprite collection.
    That worked with the fonts I tested, but those were pngs from BMFont - I'll test this using GlyphDesigner next time I'm on my mac. Thanks for taking the time to report this.


  17. Location
    Newcastle upon Tyne, UK
    Posts
    1,178
    Quote Originally Posted by mobilegamelabs View Post
    Thanks very much for your prompt reply and solving the problem.
    Yes, I mean changing from script. Moreover, I hope you will add a feature (add a few more public string variables for sprite names of a toggled state) to toggle the state of the button that, for example, when a "Pause" button is pressed (stays as pressed until clicked again), it's shown as "Play" and when it's released it's shown as "Pause", so that I don't need to change the shown image from script.

    Does global changing in Prefab not work (propagate) for the parameters in AnimatedSprite in Inspector?

    Thanks very much for your time!
    I'll put that in the TODO, but I don't think it'll be done in time for 1.70.


  18. Location
    Sydney, Australia
    Posts
    22
    Quote Originally Posted by Mikhail View Post
    You play animation from the begining while you holding down the left mouse button that's why you see the first frame.

    if(!anim.isPlaying || anim.CurrentClip.name != "High Acceleration 1")
    anim.Play("High Acceleration 1");
    Oooooh I see now thanks heaps


  19. Posts
    100
    Hi, Im trying to decide wish framework to go with. Iv made a thread on the gossip part, wish got buried, explaining my needs

    Basically I want to stack images (finished) on top of each other, aplly colliders where do, and work out the logic (dont want to mess with shaders and animation inside unity, at list not for now)

    Dont want to clutter the thread so after the jump...

    would you say 2dToolkit is for me? Do you foresee any shortcomings?
    thanks


  20. Location
    Ontario
    Posts
    37
    How do you add in multiline text from code? If I have a string "First line\nSecond Line" and add it to the text mesh it doesn't seem to work

Posting Permissions

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