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

Pages: [1]
Support / Making tk2dsprite be affected by transparent overlay
« on: October 19, 2014, 03:03:09 pm »
So I've got a tk2dsprite which has a tk2d/BlendVertexColor shader, and over it is a texture on a quad which has transparency that is basically designed to "Darken" the tk2dsprite under it as well as add some other graphical effect, currently I have it on Transparent/Diffuse shader, but no matter what shader I use the tk2dsprite is not being affected by the texture quad overlay at all.

I feel like I need to either use a different shader for the tk2dsprite or the quad, or make a small tweak to the current shaders. I have little understanding of Shaders unfortunately.

Appreciate any advice


I'm using tk2dStaticSpriteBatcher to batch a bunch of 'block' object into a collection of block objects. It looks like this:

As you can see, this batched sprite is comprised of many edge colliders.

Due to the way some other parts of my game works I need the object to have just 1 edge collider surrounding just the 'actual' edges of the object, like this:

I made that collider myself, as you can see it's pretty rough and takes a long time to edit manually by shift-clicking the collider vertices into place.

I realise tk2d doesn't really have any feature to do this, but I was wondering if you might be able to suggest some options I could try?


Support / Handling GUI positioning between different resolutions
« on: May 24, 2014, 11:16:25 am »

I'm making a game for tablet/phones which means handling all sorts of different resolutions. In the game, players get 3 lives which are indicated by 3 symbols in the top left corner.

I want these life symbols to always be a set amount of distance from the top and set amount of distance from the left.

Is there a nice way to do this that will work for arbitrary resolutions? I've tried a couple of different methods including a separate camera for GUI elements only, and using camera overrides, it won't work for all resolutions. Also looked into using tk2dlayout but can't really see how it would help me.

I'd appreciate it if you could point me in the right direction



Some of my tk2dsprites constantly stop being rendered in edit mode after pressing stop during play mode in the editor - though they are still there - you can still click on it, and the collider borders appear, but the sprites are invisible. They do appear in play mode, and will reappear if I recommit the sprite collection - but they disappear again after I finish running the game.

This seems to only happen to a couple of sprites, there are other sprites in the scene from the same sprite collection that is not problematic at all.

Edit: I seem to have fixed it by deleting the sprites and readding them again, but I feel like it could happen again in the future

Any ideas what it could be?


I'm trying to implement a throwing knife with rope attached to it. It looks like this:

The left rope sprite is a tk2d tiled sprite, and the knife on the right is an object the character is able to throw in different directions. The anchor of the rope stays wherever the character is, but the middle handle of the other side of the rope needs to keep itself exactly where the knife's handle is at. This translates to modifying the tk2d tiled sprite dimensions.x value which is in pixel units, whereas the movement of the knife will be in Unity units (whatever it is called!)

What might I be able to do to keep these 2 points together? I feel like there is some kind of formula I can use.

Not sure if it's important, but I am using 100 pixels per meter on my tk2dcamera.

Or is there a complete other way I can implement this that is much easier?


Support / How to increase size of textmesh without losing quality?
« on: February 15, 2014, 12:10:38 am »
I'm playing around with the demo scenes, specifically number "6 - button and 3d sprites". Trying to increase the size of the 'Spin Left' text so that for example it covers the entirety of the screen. I can increase the 'Scale' to make it bigger, however this makes the textmesh very pixelated. I've found the DemoFont prefab, and played around with its Size settings, but no matter what I do everytime it makes it big it just makes it really pixelated. How do I do this without losing quality?

Seems like a really basic thing, I'm sure it's actually really obvious..

edit: seems this has something to do with the size of the font texture file maybe?


I'm trying to use the Static Sprite Batcher to combine many many blocks into 1 big statically batched block, like this:

(I'm not using a Tilemap for a specific reason)

I've got a bunch of these in different shapes, all using the same 1 sprite which is in a sprite collection.

While I have all of them uncommitted the 'saved by batching' count in the statistics box is about 88. When I start committing the static sprite batch blocks this number starts go down instead of going up.

I would have logically expected the number to go up (The more you save the better, no?) Have I screwed something up or do I just understand this incorrectly?

edit: Oops, actually it looks like while the 'saved by batching' count goes down, the draw calls count also goes down drastically, so it appears to be working as it should?


Support / Assigning a layer to tilemap sprites
« on: February 06, 2014, 01:32:43 pm »

I'm building a 2D side scrolling prototype where the character is able to jump and land on the ground. Using the sample assets (beta) 2D Character prefab. I have created a new Unity layer called 'Ground' that is for all ground sprites that the character is able to land on.

How could I integrate this using the Tilemap? One way I have done it is to create a prefab of a tk2dprite that is going to be a ground, with a box collider and its layer assigned to Ground, and using the Tilemap Data feature to replace all instances of this sprite with the prefab I created. Is this the most optimal way? This becomes a problem for me currently as I'm using the same sprite for this ground that is turned upside down, and is not a ground, but of course since it's the same sprite the tilemap replaces them with the prefab I created.

If I do stick with the prefab/data method (if there is no better way) how would this perform? The levels are of course static - do tilemaps do static batching? Would they still be statically batched if they turn into my prefab?

Support / Static sprite batcher not respecting layers properly?
« on: February 06, 2014, 08:53:18 am »

I am following the Whack a Mole tutorial (http://www.unikronsoftware.com/2dtoolkit/docs/latest/tutorial/whack_a_mole/game_objects.html)

I'm doing this in Unity 4.3.x with Sorting Layers, so I'm sorting the sprites using 'Order in layer' rather than using z-values. When I click Commit on the static sprite batcher, the Sky Burst sprite moved itself on top of the landscape sprite, but if i hit Edit, then the sprite is fine again.

Does the static sprite batcher have a problem respecting layers? or did I do something wrong

Before Commit:

And After Commit:

Support / Can't left click to select objects behind the TileMap
« on: February 05, 2014, 11:54:41 am »
Hi guys,

I've got a 2D scene with a tilemap and a tk2d sprite object inside the borders of the tilemap. Everytime I left click on the tk2d sprite, it always selects the Tilemap object instead of the tk2d sprite. I then added a cube (standard Unity cube). I can select these cubes with left mouse click without any problems.

What can I do to fix this? It's actually driving me insane

Edit: It seems if I position the sprite's Z axis position in front of the tilemap it seems to work. Is there any other way?

Pages: [1]