2D Toolkit Forum

2D Toolkit => Support => Topic started by: notsoobvious on September 26, 2013, 10:04:31 pm

Title: changing the depth of my tiles
Post by: notsoobvious on September 26, 2013, 10:04:31 pm
So I'm new to game dev, unity and 2dtk and after learning much about layers, decided I needed to change the position of the depth of my objects.

My cam is at pos.z = -10 and most of my level is at z = 0, but I wanted to put something in front of the main layer, I.e in between the cam and 0 (say -0.1). Firstly, why doesn't 2dtk allow you to change the depth to that layer value in the settings tile tab? (assuming that text box is depth, there is little to no real documentation other than at http://www.unikronsoftware.com/2dtoolkit/docs/1.92/tilemap/tutorial.html)

It seems 0 is a minimum. Trying to sidestep this: I tried changing the layers around so that most of my game is at 1, and I can put something at say 0.1, but after I place the tiles, it doesn't seem to allow me to replace the depth.

I tried changing the depth in the chunk object produced in the heirarchy view, and the layer depth from the text box in the tile settings tab. It changes until I hit run, at which point it reverts back to 0.

Please assist! (Please note I'm using 1.92 for now as that's what I started with!)

Edit: I don't want to delve into the scripting API for this as I don't feel it's a task that requires a script, thanks!)
Title: Re: changing the depth of my tiles
Post by: notsoobvious on September 27, 2013, 09:38:26 am
No one have a clue?

Are the tile settings more user-friendly if I update 2dtk to the latest version?
Title: Re: changing the depth of my tiles
Post by: unikronsoftware on September 27, 2013, 09:56:28 am
1.92 is a really old version, we're at 2.2 now and the tilemap stuff has changed significantly. Here's the reference for it, you can either use an offset, or have fixed z values.

http://unikronsoftware.com/2dtoolkit/doc/2.20/tilemap/reference.html
Title: Re: changing the depth of my tiles
Post by: notsoobvious on September 27, 2013, 10:49:08 am
I remember reading somewhere that the 1x and 2x versions are incompatible but I've searched the forums and cannot find that thread.

If I Upgrade to 2x, how will this affect my current project (if at all)? Will I still keep my sprite collections/tilesets?
Title: Re: changing the depth of my tiles
Post by: unikronsoftware on September 27, 2013, 10:56:34 am
tk2d 2.x is not code compatible - you'll need to update some code during the upgrade. All of this is outlined here:
http://unikronsoftware.com/2dtoolkit/doc/2.20/migration_guide.html

However, data is pretty much 100% compatible, so your sprite collections, tilemaps, scenes, etc should all just work as they did before - after you fix the code of course.

As always, make a backup of your project before trying to update.
Title: [solved by updating] changing the depth of my tiles
Post by: notsoobvious on September 27, 2013, 01:10:06 pm
Thank you sir I shall upgrade now!

(P.S I feel strongly that a trial version of 2dtk is worth your while)