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

Pages: [1]
Support / Is there a way to change the speed of an animation in code?
« on: December 11, 2020, 02:45:27 am »
I've been trying this, but it doesn't change anything?

gameObject.GetComponent<tk2dSpriteAnimator> ().ClipFps = 12.0f;

No matter what I do, whenever I read the variable it just returns -1.


I recently updated 2D Toolkit to the latest version to get it working with Unity 5.6, but now whenever I try to save my scenes they freeze up.  The first thing I noticed that is different is an "importing small assets" pop-up appears every time I save now.  It is usually on screen for about 3 or 4 seconds then it disappears, but everything freezes up.  Some of the scenes will be frozen for a few minutes but will eventually save successfully, while others I left running a half hour or more and they wouldn't save at all.  I am assuming they get stuck in some loop or something and would never finish.



I have a SpriteCollection with 26 individual sprites that I am currently using in a TileMap.  I would like to replace those sprites with a single sprite sheet containing all 26 sprites, without having to go back and place everything again on the TileMap.  However, I can't figure out if this is possible.  If I go into my SpriteCollection and delete the old sprites and add the sprite sheet, the elements in the sprite sheet all have new Sprite IDs (which do not seem to be able to be edited), and I'm not sure how, if even possible, to get them to replace the old sprites instead of having new IDs and acting as totally separate sprites in the TileMap.

Is this possible?  If so, how?!

Thank You.

Support / Re: Is 1024x1024 the absolute largest that a tilemap can be?
« on: January 11, 2015, 11:53:52 pm »
I should have been more clear, that is just for my top to bottom stages.  For left to right stages the reverse is true... I don't need as much height but I need additional width.

So in that code...

public static int MaxWidth = 1024;
public static int MaxHeight = 1024;

Is it possible to make both of these numbers bigger in the code?  I'd never have both bigger than 1024 at the same time, just either one dependent on whether it is a top to bottom or left to right stage.  I don't know exactly how much bigger that I need yet, but I'd say around 1.5 times at least each way (1536ish for each?)

So my requirements would be something like...

Top to Bottom stages:
256 x 1536

Left to Right stages:
1536 x 256

I'm not totally sure on any of these numbers yet either, just estimates.  Is there a hard limit?

Support / Is 1024x1024 the absolute largest that a tilemap can be?
« on: January 11, 2015, 09:47:35 pm »
When I go into a tilemap and go to settings -> dimensions for my vertical stage, my current layout is this:

Width: 128
Height: 1024
PartitionSizeX: 32
PartitionSizeY: 32

I definitely need more space than this vertically.  However, when I go to change the 1024 number, it won't let me go any bigger.  Is there any way around this?  If not, what would you suggest for stages that need more space?  Two tilemaps on top of each other?  (More accurate would be two times 10 or so tilemaps on top of each other, because I actually use about 10 tilemaps in each stage for a variety of layers...)


I'm having a bit of trouble wrapping my head around this.

So far, I have been using Unity's system to take a spritesheets and chop it up into sprites, then then take each of those sprites, attach a bit of code to them and turn them all into prefabs.  Separate from that, I have 2dtk pull the same spritesheet into a sprite collection, and I use that sprite collection to create a tile map that I can design my stages with.  My final step is to go to the "data" part of the 2dtk tile map and connect the prefabs I made in Unity to the corresponding tiles, so I can design the stages with my actual prefabs.

This works, but I'm trying to move away from using Unity's system to deal with the spritesheets / sprites.  Ideally I want to just manage my spritesheet in a 2dtk sprite collection and use those pieces to create my prefabs.

I guess I'm just struggling figuring out the easiest way to use 2dtk to create all of those prefabs that I will be linking into the "data" part of the tile map.  If I understand what you're saying (and I'm not sure that I do), I would create a spriteless prefab and then determine which sprite gets attached to it with SetSprite("name"), or something along those lines?  And to get all 100 prefabs, I'd need to do that 100 times?  Or am I missing something easier here?

Is there a tutorial on SetSprite anywhere?

So, I created a sprite collection and imported a spritesheet just fine, it chopped it up nicely.  All of my pieces look perfect.  However, I need to use the pieces as individual sprites that I am connecting a bunch of code to and creating individual prefabs from. 

I know that I can do create -> tk2d -> sprite and then select the piece that I want.  However, I have a good 100+ pieces, and eventually will have a good 1,000+.  Is there a way to just create a whole batch of sprites at once using a sprite collection?  They would all have the same exact properties, so I feel like this should be possible, but I can't seem to find it anywhere.  It seems like it would take a long, long time to create them all one by one.

Or maybe there is something else I'm missing?  I know when you chop up a spritesheet in Unity 4.3 it automatically creates all of the individual sprites...

Cool thanks, that works!

One more question... I basically just want to use the tile map as a level editor with a bunch of prefabs that I have.  In the tutorial that I did, it had me load in a sprite sheet and then in the tile map choose data -> prefab to have the sprite replaced with the prefab during runtime.  Is there a quicker / easier way to do this?  I don't really have a sprite sheet that relates to my prefabs so I'd either have to create a sprite sheet full of sprites that represent my prefabs, or just make a blank sprite sheet or something and link the prefabs to it.  Neither way really seems ideal...

I'm not sure if my image attached correctly, if not, here it is:


Support / Tiles from tilemap are appearing much larger than expected
« on: June 13, 2014, 12:06:08 am »
Hi, I apologize in advance if this is a very n00bish issue, I'm pretty new to game dev (6 months?) and I'm very new to 2D Toolkit, which I just dove into a few days ago.

Basically, my issue is that using this tutorial:


I have set up a tilemap, which appears to work fine except... the tiles are appearing about 4? times as large as expected when placed next to my other assets?  Everything is on the same z-axis so it's not a depth issue I don't think.  My tiles are all 64x64 but even using the same exact tiles, they are coming out much larger when used in my tilemap.

I'm using Unity 4.3 with the 2D mode, so maybe that is related to my issue?  Do I have to do something special to make it work with 4.3s 2D mode?  I followed the tutorial above to the letter except for this part, which I believe is not possible in 2D mode:

"Part 2 - Basic painting.
1. Make sure your scene view is set to "Back" and "Perspective" is turned off."

Anyway, kind of lost and not sure how to progress.  I'm attaching an image so you can see what I mean.

Pages: [1]