Hello Guest

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - saygon

Pages: [1]
1
Support / Edit sprite collection that located in resource in editor
« on: March 03, 2013, 04:33:21 pm »
Hi all.

I want to load sprite in runtime from collection - I am loading sprite collection from resources folder.
But when I created new sprite collection in resources folder, I got this error: "sprite collection in resources directory. editor is disabled. Move it out of the resource directory to continue".

How I can fix it?

2
Support / Sprite.ForceBuild() errors perfomance.
« on: February 18, 2013, 11:33:20 pm »
Hi there.
I use serilazation from xml and want to create sprites in runtime. My strategy is follow:

1. Instantiate sprite from sprite prefab.
2. Select proper spriteid and collection (call SwitchCollectionAndSprite).
3. After this sprite images are changed, but collider are not created properly - collider is still from old sprite.
4. Call ForceBuild(). After this new collider will be created.

But step 4 occurs to "Invalid mesh collider on sprite, please remove and try again." error.
In this post: http://unikronsoftware.com/2dtoolkit/forum/index.php/topic,1131.msg5381.html#msg5381  I read that it's error in unity and it's not a fatal and it's resolved in short time.

But it's in editor mode - I create sprite in runtime, so perfomace is not clear for me - I have 90 errors in editor console for one level load (1 error for one sprite creation).
Can this lead to application crash? Should I wrap this in try-catch (but in this case I will have >90 call of catch block and it's very perfomance expensive).
Maybe exists some workaround for this stuff (Create sprites in runtime with different collider types)?
I see that  EditMode__CreateCollider() did not lead to exceptions or errors, but it annotated as call only in editor. Can I use it (with modification of course)?

Thanks in advance.

Update:
ForceBuild works in Editor but does not work on release build (win standalone) - collider from old sprite is still exist.
I modified EditMode__CreateCollider() method (remove #if Editor directives) and call it from script instead ForceBuild() - seems like issue fixed.
I will try this workaround on Android and let you know about results.

3
Support / Re: Spaces between sprites under different resolution.
« on: January 29, 2013, 09:39:22 pm »
Thank you guys.

Set pad method to Extends fixed this problem.

2d Toolkit is really cool thing!

4
Support / Re: Spaces between sprites under different resolution.
« on: January 29, 2013, 12:38:42 pm »
I think I found that I looked -
I read 2d toolkit user manual pdf and probably I should use unity editor vertex snap mode.

I will write about results.

5
Support / Spaces between sprites under different resolution.
« on: January 29, 2013, 11:45:26 am »
Hi guys.

I developing game on Android (some sort of constructor).
I have a row of the same sprites. I created sprites in unity editor and set the position  in such a way that between them there is no empty space.
But when I change resolution (to TegraTablet, HTC Wildfire, etc.), I can see the empty space (1-2 pixels) between some sprites.
When I move sprites to avoid this space, in some other resolutions I get empty space again.

I am using unity camera (non tk2dCamera). Camera ortho size - 5.
Sprite scales in collection editor 8X8X8.
2d toolkit version - 1.7.

How I can fix this?
Thanks in advance.

6
Support / Re: Commit sprites using StaticSpriteBatcher in runtime.
« on: January 29, 2013, 10:49:14 am »
Thank you very much!

This approach works perfectly.

7
Support / Commit sprites using StaticSpriteBatcher in runtime.
« on: January 21, 2013, 11:49:23 am »
I have idea of game, where level created from small cubes.
I want to use 2d toolkit for this:
So, I have a lot of sprites from one sprite collection and I want to commit a bach of these sprites created in runtime.
So, the steps are follows:
1. Create sprites in runtime (I found on this forum how do to it).
2. Commit all sprites that attahced to different game objects using StaticSpriteBatcher.

Can I do it (step 2), using 2d toolkit, because in reference I can not found StaticSpriteBatch class?

Pages: [1]