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.


Topics - Trigve

Pages: [1]
1
Support / Order in layer vs. Z-ordering priority
« on: December 10, 2014, 10:14:08 am »
I was just playing with the "order in layer" and z position of the sprites and want to be sure (because found out in some previous version of unity it was working differently).

The priority has the "order in layer". That is, the sprite with higher order than some other sprite is drawn at the "top", the Z-position isn't taken into account. Only if the "order in layer" are the same, the Z-position is taken into account and could fine tune the draw order.

Am I getting this right?

One more question, what is the maximum value of the "order in layer"? Is it somehow dependent on the (Z buffer)/(near-far plane position)? I found that max positive value is (2^15) - 1.

Thanks


2
Support / tk2dSpriteAnimator.CurrentFrame lag
« on: November 04, 2014, 10:39:24 pm »
Hi,
I'm trying to move the sprite on each frame change using coroutines. I'm comparing the current and the last frame of the tk2dSpriteAnimator. But the "CurrentFrame" property is lagging the 1 frame after the actual sprite has been already changed (that is, I can see that the sprite has been changed, either visually or in game object inspector, but the value in the code is still the old one). Is this known behaviour or am I doing something wrong?

Thanks

3
Support / Create Sprite Collection from code
« on: October 16, 2014, 09:19:53 pm »
Hi,
Is it possible to create the sprite collections purely from the code in the editor?

 I was poking around the sources and found the tk2dSpriteCollectionEditor and tk2dSpriteCollectionBuilder which could possibly create the sprite collection prefab. Then I think I would need to obtain the tk2dSpriteCollectionData somehow and add the sprite definitions there. Should I jut create new tk2dSpriteDefinition array and associate it to the "spriteDefinitions" field in the tk2dSpriteCollectionData ? Then after everything is done, I would call the tk2dSpriteCollectionBuilder.Rebuild() for committing the changes. Is this right? Or is there any other workflow?

Thank You

4
Support / Sprite distortion in pixel perfect setup
« on: October 01, 2014, 08:34:00 am »
Hi,
I have a scene with tk2dCamera with PixelsToUnit set to 1 (It was set to 100 but I changed it to the 1 to rule out floating-point precision errors). I have 12 frame animation with sprites which are NPOT and the dimensions of the each sprite could vary. Each sprite has anchor point set. The camera position is aligned to the pixel. The GO with the sprite animator is aligned to the pixel. If I start player, the one exact frame in the middle of the animation, is always "distorted". That is, it looks like it was stretched 1 pixel right. I can PM you some demo project so you can try it for yourself. If I set the position of the GO of the sprite to sub-pixel value, i.e. 0.5, then distortion doesn't occurs. I also see this distortion on this exact frame in the tk2d animation editor when playing/stepping the animation.

Also when viewing this single sprite in the tk2d sprite editor (or in the image editor like gimp) it looks ok.

It looks like some sub-pixel error somewhere but could not find where it cam from.

Thank you

5
Support / Per sprite pixels to unit
« on: April 17, 2014, 09:58:58 am »
Hi,
I'm evaluating the 2D toolkit (through documentation) and was curious how to setup the pixels to unit ration per sprite (as it is done in unity). That is I want to have some sprites to have some defined pixels to unit ratio and some other sprites to have some other pixels to unit ratio. I've found that on camera one can set pixels per meter but it looks like it is the global (and I want the per sprite; and not for meter but for units). It looks like the Sprite has the custom scale option which could work but I'm not sure.

It is possible to set pixels to unit per sprite basis?

Thank you

Trigve

Pages: [1]