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 - Zakwil

Pages: [1]
1
Support / Re: Perfect gap with tk2dStaticSpriteBatcher
« on: May 11, 2013, 07:27:37 pm »
Thanks, working perfectly.

2
Support / Re: Perfect gap with tk2dStaticSpriteBatcher
« on: May 11, 2013, 04:48:37 pm »
I succeed to get the bounds data into the sprite definition.

But I have to set the Filter Mode to Point to avoid gap between the sprites (from PNG non transparent).

If I try Bilinear the gap disapear but when I zoom the sprite is not smothed. Any chance to have smothed zoom and no gap?

3
Support / Re: Simply setting a sprite width/height - how?
« on: May 06, 2013, 07:21:30 am »
Maybe you have the same problem I got, check the answer unikron gave me : http://unikronsoftware.com/2dtoolkit/forum/index.php/topic,1620.0.html

(I'll check it tonight).

4
Support / Re: Perfect gap with tk2dStaticSpriteBatcher
« on: May 06, 2013, 07:19:25 am »
1. I just test with these numbers, but the dimensions of the sprite were a little bit random, I confess

2 .I'll check with this function

3. The idea having 2 cameras is "normal" or not ?

5
Support / Perfect gap with tk2dStaticSpriteBatcher
« on: May 05, 2013, 08:50:15 pm »
Hello,

I try to use the tk2dStaticSpriteBatcher. But I've got a problem with the gap between the sprites composing the Static Sprite Batcher.

First I'm using a unity camera to keep the perspective view (add 3d model & background).

I want to create a background with tiled sprites and use the StaticSpriteBatcher to avoid to create many gameobject.

I succeed to display 4 by 4 tiles but the gap is a problem, position or scale I think...

How can I get the right sprite height & width ?

Code: [Select]
GameObject spriteBatcherGO = new GameObject("BGSpriteBatcher");
tk2dStaticSpriteBatcher staticSB = spriteBatcherGO.AddComponent<tk2dStaticSpriteBatcher>();

staticSB.spriteCollection = collectionLevel;
spriteBatcherGO.transform.localPosition = new Vector3(1, 1, 1);
spriteBatcherGO.transform.localScale = new Vector3(1f,1f,1f);

tk2dBatchedSprite[] batchedSpriteList = new tk2dBatchedSprite[4 * 4];
int index = 0;
for (int i = 0; i < 4; ++i)
{
for (int j = 0; j < 4; ++j)
{
tk2dBatchedSprite batchedSprite = new tk2dBatchedSprite();
batchedSprite.spriteId = (i % 2 == 0)?1:0;// black or white tile
batchedSprite.localScale = new Vector3(5.5f,5.5f,5.5f);
// 5.5f is a manual and not perfect number

batchedSpriteList[index] = batchedSprite;
++index;
}
}

staticSB.batchedSprites = batchedSpriteList;

staticSB.Build();
staticSB.transform.localScale = new Vector3(50f,50f,1f);

Edit : I tried with 2 cameras : one 2dtk (ortho) and a unity (perspective), worked fine in the editor, but the 2dtk camera didn't display anything on the built exe.

Pages: [1]