2D Toolkit Forum

2D Toolkit => Releases => Topic started by: unikronsoftware on July 07, 2013, 04:20:04 pm

Title: 2D Toolkit 2.1 beta 1
Post by: unikronsoftware on July 07, 2013, 04:20:04 pm
Please read the migration guide before updating. 2D Toolkit 2.x is not API compatible with 1.x.
http://unikronsoftware.com/2dtoolkit/docs/2.10/migration_guide.html

Documentation available at:
http://unikronsoftware.com/2dtoolkit/docs/2.10

NOTE: Documentation and demos haven't been updated for the new features in 2.1 yet, that will be done by the next beta.

What's new

Bug fixes and improvements
Title: Re: 2D Toolkit 2.1 beta 1
Post by: igmon on July 07, 2013, 06:14:24 pm
I got this compile error:

Assets/TK2DROOT/tk2d/Editor/Sprites/tk2dSpriteAnimatorEditor.cs(222,33): error CS0246: The type or namespace name `tk2dUISpriteAnimator' could not be found. Are you missing a using directive or an assembly reference?

Looks like a dependency for the tk2d UI stuff.
Title: Re: 2D Toolkit 2.1 beta 1
Post by: fsadeq on July 07, 2013, 06:16:21 pm
Great! Thanks for this. Quick question, though - My Tilemap toolbar icons are blown up and super blurry for some reason. This is only an issue for my existing tile maps. If i make a new tilemap, the icons look perfectly crisp. Any idea why this would be happening?? I've tried completely deleting the TK2DROOT folder and re-importing this latest release, but it still looks blurry/blown up with my existing maps. I've attached a picture so you see what I'm talking about:
Title: Re: 2D Toolkit 2.1 beta 1
Post by: unikronsoftware on July 07, 2013, 06:23:05 pm
I got this compile error:

Assets/TK2DROOT/tk2d/Editor/Sprites/tk2dSpriteAnimatorEditor.cs(222,33): error CS0246: The type or namespace name `tk2dUISpriteAnimator' could not be found. Are you missing a using directive or an assembly reference?

Looks like a dependency for the tk2d UI stuff.

Did you selectively not import the UI stuff?
Title: Re: 2D Toolkit 2.1 beta 1
Post by: unikronsoftware on July 07, 2013, 06:24:12 pm
Great! Thanks for this. Quick question, though - My Tilemap toolbar icons are blown up and super blurry for some reason. This is only an issue for my existing tile maps. If i make a new tilemap, the icons look perfectly crisp. Any idea why this would be happening?? I've tried completely deleting the TK2DROOT folder and re-importing this latest release, but it still looks blurry/blown up with my existing maps. I've attached a picture so you see what I'm talking about:

Is there something in the quality settings rescaling your textures? By a new tilemap, I'm guessing its within the same project?
Title: Re: 2D Toolkit 2.1 beta 1
Post by: fsadeq on July 07, 2013, 06:27:25 pm
Actually - good point. In a different project. My texture quality settings are set at half-res. Making them full-res fixes it.
Title: Re: 2D Toolkit 2.1 beta 1
Post by: fsadeq on July 07, 2013, 07:29:03 pm
Instanced prefab data still is pretty buggy. It doesn't save them 50% of the time. One scenario that I can replicate each time is:

-Edit the tilemap, paint a prefab tile, commit
-Select the prefab, change some values
-Edit the tilemap again, create a color channel
-Paint anything with the color channel
-Delete the color channel
-Commit the tilemap

Prefab instance data is no longer saved and reverted to the default values.
Title: Re: 2D Toolkit 2.1 beta 1
Post by: igmon on July 07, 2013, 10:04:38 pm
I got this compile error:

Assets/TK2DROOT/tk2d/Editor/Sprites/tk2dSpriteAnimatorEditor.cs(222,33): error CS0246: The type or namespace name `tk2dUISpriteAnimator' could not be found. Are you missing a using directive or an assembly reference?

Looks like a dependency for the tk2d UI stuff.

Did you selectively not import the UI stuff?

Yeah, I'm using my own UI stuff and haven't decided to use the tk2d stuff just yet. It's no biggie, just something that breaks compile if someone doesn't import the UI portion of tk2d.
Title: Re: 2D Toolkit 2.1 beta 1
Post by: aaron7090 on July 07, 2013, 11:02:15 pm
There is a bug with tk2dTextMesh.Commit(); the first time it works the second time the tk2dTextMesh.Commit(); renders nothing. Only noticed this issue when I tested on a android device.
Title: Re: 2D Toolkit 2.1 beta 1
Post by: profanicus on July 08, 2013, 05:14:19 am
WOW this new tk2d camera is awesome. Seriously good - I just love the pixels per meter.
Title: Re: 2D Toolkit 2.1 beta 1
Post by: m4ko on July 08, 2013, 08:49:01 am
I have a question regarding the new camera:

Up until now I used ScaledResolution to scale a sprite in width. I have a TopLeft and TopRight tk2d anchor set. There is a gui tile in both of them connecting in the center at native resolution. If the aspect ratio is increased there will be a gap. That is where the tiled sprite is placed. I set its x-dimension to the gap-size.

Now with the ScaledResolution i did this:
Code: [Select]
p_sprite_barExtension.dimensions = new Vector2(BLAH.ScaledResolution.x - (600 * 2), p_sprite_barExtension.dimensions.y);

As you removed ScaledResolution I guess there is a better alternative? I don't understand all the tk2dcamera details. Could you help me out to get the correct gapo size again?
Title: Re: 2D Toolkit 2.1 beta 1
Post by: unikronsoftware on July 08, 2013, 01:53:36 pm
@m4ko -
I'll cover all of those little changes in the migration guide and new docs for tk2dCamera. Since the tk2dCamera can now be any size (not limited to 1 pixel per meter), something like the code you have could be meaningless at a different resolution.

Eg. if you want to fill the screen, regardless of camera size, etc.
float dimensionX = cam.ScreenExtents.width / ( sprite.CurrentSprite.texelSize.x * sprite.scale.x );
will do the job.
Title: Re: 2D Toolkit 2.1 beta 1
Post by: unikronsoftware on July 08, 2013, 01:55:55 pm
There is a bug with tk2dTextMesh.Commit(); the first time it works the second time the tk2dTextMesh.Commit(); renders nothing. Only noticed this issue when I tested on a android device.

Renders nothing, as in doesn't do anything, or actually clears the data? Can you post in a bit more detail in the private support forum, please?
Title: Re: 2D Toolkit 2.1 beta 1
Post by: unikronsoftware on July 08, 2013, 01:57:58 pm
Instanced prefab data still is pretty buggy. It doesn't save them 50% of the time. One scenario that I can replicate each time is:

-Edit the tilemap, paint a prefab tile, commit
-Select the prefab, change some values
-Edit the tilemap again, create a color channel
-Paint anything with the color channel
-Delete the color channel
-Commit the tilemap

Prefab instance data is no longer saved and reverted to the default values.

I think you posted this before, and I must've missed this. Thanks for reminding me, it'll be fixed in the next release.
Title: Re: 2D Toolkit 2.1 beta 1
Post by: fsadeq on July 08, 2013, 04:27:22 pm
Instanced prefab data still is pretty buggy. It doesn't save them 50% of the time. One scenario that I can replicate each time is:

-Edit the tilemap, paint a prefab tile, commit
-Select the prefab, change some values
-Edit the tilemap again, create a color channel
-Paint anything with the color channel
-Delete the color channel
-Commit the tilemap

Prefab instance data is no longer saved and reverted to the default values.

I think you posted this before, and I must've missed this. Thanks for reminding me, it'll be fixed in the next release.

Great, thanks. Also, not sure it's already on your radar but it was mentioned before that you can no longer use your mouse wheel to scroll the palette in the tilemap editor.
Title: Re: 2D Toolkit 2.1 beta 1
Post by: fsadeq on July 08, 2013, 04:33:16 pm
Regarding the new tk2dCamera, I know that you now hide the native camera component - I'm noticing that this isn't the case for any prefabs that have the tk2dcamera attached. Going to assume there's just no way around this?

Also, I like the pixels / meter thing, but is there a way to keep an accurate scale of the sprites, but still have an increased ratio? I'd like something like 10 pixels/meter, but want to retain the accurate scale on screen while still using tk2dCamera. Thanks.
Title: Re: 2D Toolkit 2.1 beta 1
Post by: unikronsoftware on July 08, 2013, 04:39:09 pm
Instanced prefab data still is pretty buggy. It doesn't save them 50% of the time. One scenario that I can replicate each time is:

-Edit the tilemap, paint a prefab tile, commit
-Select the prefab, change some values
-Edit the tilemap again, create a color channel
-Paint anything with the color channel
-Delete the color channel
-Commit the tilemap

Prefab instance data is no longer saved and reverted to the default values.

I think you posted this before, and I must've missed this. Thanks for reminding me, it'll be fixed in the next release.

Great, thanks. Also, not sure it's already on your radar but it was mentioned before that you can no longer use your mouse wheel to scroll the palette in the tilemap editor.

That has been mentioned, but I don't know how to fix it yet.
It now supports scrolling horizontally in there, and Unity eats the scrollbar message before it gets in there. There might be a way around it but I don't have a solution to this as of yet. One option might be to not use the palette at all, but simply copy the full contents of the palette into a scratchpad and hide the palette itself...
Title: Re: 2D Toolkit 2.1 beta 1
Post by: unikronsoftware on July 08, 2013, 04:43:41 pm
Regarding the new tk2dCamera, I know that you now hide the native camera component - I'm noticing that this isn't the case for any prefabs that have the tk2dcamera attached. Going to assume there's just no way around this?

Also, I like the pixels / meter thing, but is there a way to keep an accurate scale of the sprites, but still have an increased ratio? I'd like something like 10 pixels/meter, but want to retain the accurate scale on screen while still using tk2dCamera. Thanks.

It should hide itself once brought into the scene (I think...). If you click on the little cog icon at the far right of the tk2dCamera component, you will find a "Toggle Unity cmaera" menu entry in there. You can use that to hide it.

If you want 10 pixels per meter, you need to change the sprite collection settings to 10 pixels per meter there as well. You can also grab from the scene camera ("g") if you need to. The next tutorials will encourage creating the camera before creating the scene (if there is a camera in the scene, the sprite collection settings will automatically inherit from there without you having to set anything up. This only happens when creating a sprite collection though.).
Title: Re: 2D Toolkit 2.1 beta 1
Post by: unikronsoftware on July 08, 2013, 05:14:35 pm
Instanced prefab data still is pretty buggy. It doesn't save them 50% of the time. One scenario that I can replicate each time is:

-Edit the tilemap, paint a prefab tile, commit
-Select the prefab, change some values
-Edit the tilemap again, create a color channel
-Paint anything with the color channel
-Delete the color channel
-Commit the tilemap

Prefab instance data is no longer saved and reverted to the default values.

I think you posted this before, and I must've missed this. Thanks for reminding me, it'll be fixed in the next release.

A patch which should fix this, and probably most others. Could you please try to break this? :D
ps it only changes one file, and shouldn't cause any issues if you're already on 2.1 beta.
Title: Re: 2D Toolkit 2.1 beta 1
Post by: fsadeq on July 09, 2013, 01:11:49 am
Instanced prefab data still is pretty buggy. It doesn't save them 50% of the time. One scenario that I can replicate each time is:

-Edit the tilemap, paint a prefab tile, commit
-Select the prefab, change some values
-Edit the tilemap again, create a color channel
-Paint anything with the color channel
-Delete the color channel
-Commit the tilemap

Prefab instance data is no longer saved and reverted to the default values.

I think you posted this before, and I must've missed this. Thanks for reminding me, it'll be fixed in the next release.

A patch which should fix this, and probably most others. Could you please try to break this? :D
ps it only changes one file, and shouldn't cause any issues if you're already on 2.1 beta.

Broke it on my first try  ;D

Does the same exact thing with the repro from above.
Title: Re: 2D Toolkit 2.1 beta 1
Post by: fsadeq on July 09, 2013, 04:28:24 am
Just noticed the awesome new layer section in the tilemap editor. Looks and functions great. Small request? Is it possible to be able to set negative offsets for layers? I'd like my background layers to be in negative z, so my "main" layer can be at 0.
Title: Re: 2D Toolkit 2.1 beta 1
Post by: profanicus on July 09, 2013, 04:38:12 am
Turn on the 'Fixed Z' button then you can set whatever values you like.
Title: Re: 2D Toolkit 2.1 beta 1
Post by: Dylan on July 09, 2013, 05:53:45 am
How relevant is the Migration Guide, if going from 2.0 to 2.1? Aside from backing things up and taking advantage of new features, is there anything I need to be particularly mindful of?

Thanks, looking forward to using it.
Title: Re: 2D Toolkit 2.1 beta 1
Post by: unikronsoftware on July 09, 2013, 12:53:49 pm
Instanced prefab data still is pretty buggy. It doesn't save them 50% of the time. One scenario that I can replicate each time is:

-Edit the tilemap, paint a prefab tile, commit
-Select the prefab, change some values
-Edit the tilemap again, create a color channel
-Paint anything with the color channel
-Delete the color channel
-Commit the tilemap

Prefab instance data is no longer saved and reverted to the default values.

I think you posted this before, and I must've missed this. Thanks for reminding me, it'll be fixed in the next release.

A patch which should fix this, and probably most others. Could you please try to break this? :D
ps it only changes one file, and shouldn't cause any issues if you're already on 2.1 beta.

Broke it on my first try  ;D

Does the same exact thing with the repro from above.

Did you already have it in edit mode before trying it - it could already be broken then? I'm pretty sure I got that one case, at least - it was being caused by "initializing" the tilemap into edit mode twice, which ends up being a bad thing to do. I'll check again later to make sure I've actually copied the right files into that package...
Title: Re: 2D Toolkit 2.1 beta 1
Post by: unikronsoftware on July 09, 2013, 12:55:55 pm
How relevant is the Migration Guide, if going from 2.0 to 2.1? Aside from backing things up and taking advantage of new features, is there anything I need to be particularly mindful of?

Thanks, looking forward to using it.

Going from 2.0 -> 2.1, there are a few smallish changes that need to be made to code - a lot of the stuff wasn't documented to start with, mainly to do with tilemaps. The only stuff actually broken between 2.0 -> 2.1 is the tk2dCamera.ScreenExtents, etc. You should be fine if you don't use that. A mini migration guide will be going up with the docs, probably in time for beta2, but if you run into any issues, just post here.
Title: Re: 2D Toolkit 2.1 beta 1
Post by: fsadeq on July 09, 2013, 06:08:22 pm
Instanced prefab data still is pretty buggy. It doesn't save them 50% of the time. One scenario that I can replicate each time is:

-Edit the tilemap, paint a prefab tile, commit
-Select the prefab, change some values
-Edit the tilemap again, create a color channel
-Paint anything with the color channel
-Delete the color channel
-Commit the tilemap

Prefab instance data is no longer saved and reverted to the default values.

I think you posted this before, and I must've missed this. Thanks for reminding me, it'll be fixed in the next release.

A patch which should fix this, and probably most others. Could you please try to break this? :D
ps it only changes one file, and shouldn't cause any issues if you're already on 2.1 beta.

Broke it on my first try  ;D

Does the same exact thing with the repro from above.

Did you already have it in edit mode before trying it - it could already be broken then? I'm pretty sure I got that one case, at least - it was being caused by "initializing" the tilemap into edit mode twice, which ends up being a bad thing to do. I'll check again later to make sure I've actually copied the right files into that package...

I didn't. I even opened up a new scene and edited a tilemap in there.. sorry, haha.
Title: Re: 2D Toolkit 2.1 beta 1
Post by: unikronsoftware on July 09, 2013, 06:38:22 pm
 :( I'm just hoping the patch is broken... I'll check and get back to you later.
Title: Re: 2D Toolkit 2.1 beta 1
Post by: fsadeq on July 10, 2013, 04:28:18 am
Turn on the 'Fixed Z' button then you can set whatever values you like.

Ah, cool. Thanks!
Title: Re: 2D Toolkit 2.1 beta 1
Post by: midasmax on July 10, 2013, 01:41:28 pm
Hi guys,

Exciting release! Thanks for the hard work! :)

I was wondering what is the best practice for updating from 2.00 to 2.10? I initially did the 2D Toolkit Package import from the Asset Store. I assume that since 2.10 Beta is not on the Asset Store, I will have to download and use the unitypackage and manually import it. What should I look out for prior to doing this? Do I simply go ahead, or do I need to erase the existing folders/package first?

Also, after importing, do I have to restar the editor?

Thanks!
Title: Re: 2D Toolkit 2.1 beta 1
Post by: unikronsoftware on July 10, 2013, 02:49:02 pm
Backup your project (IMPORTANT), import 2.1, restart editor (not essential but good practice).
Should be good to go.

And report any bugs here :)
Title: Re: 2D Toolkit 2.1 beta 1
Post by: midasmax on July 10, 2013, 04:48:36 pm
Thanks for the tips! The import worked fine!

Playing around with the new overrides interface in the editor! It appears that there is a difference between using exact resolutions, and using aspect ratios in Game View, and how it interfaces with the Force Resolution checkbox! :)
Title: Re: 2D Toolkit 2.1 beta 1
Post by: unikronsoftware on July 10, 2013, 05:30:27 pm
Yes there is. Its recommended to set exact resolutions in game window, if you don't want to deal with setting up resolutions again :)
Title: Re: 2D Toolkit 2.1 beta 1
Post by: fsadeq on July 11, 2013, 02:53:31 am
Weird bug in the tilemap. I'm not sure how to reproduce it, but I am unable to erase some tiles on one of my layers. I can paint a new one on top of it, but when I erase that, the old one is still underneath it. It is strange because when I commit the map, the colliders for the tiles aren't being created, so it's just the mesh that is stuck in there. Any idea what could be causing this? And yes I am 100% trying to erase on the correct layer  :)

EDIT: Ok, weird. For whatever reason it created like 5 duplicate chunks alongside the "normal" one. I manually deleted them, and it's fine now. Still a bit frightening, though..
Title: Re: 2D Toolkit 2.1 beta 1
Post by: MyNameIsDonovan on July 11, 2013, 05:56:28 am
Unikron, it looks like lighting on tilemaps does not work atm.
And i cant use this to fix it: http://unikronsoftware.com/2dtoolkit/forum/index.php/topic,1080.msg5137.html#msg5137

Am I missing something?
Title: Re: 2D Toolkit 2.1 beta 1
Post by: profanicus on July 11, 2013, 07:26:09 am
Unikron, it looks like lighting on tilemaps does not work atm.
And i cant use this to fix it: http://unikronsoftware.com/2dtoolkit/forum/index.php/topic,1080.msg5137.html#msg5137

Am I missing something?

Find the tk2dTileMapMeshBuilder.cs file, search for this line:
Code: [Select]
chunk.mesh.RecalculateBounds(); and add this below it:
         
Code: [Select]
chunk.mesh.RecalculateNormals ();
Title: FPS hit when enabling the TK2DCamera
Post by: Fausto on July 11, 2013, 08:30:28 am
Hello friends!

That v3 camera is looking quite nice!
I might have found a problem, though. Just imported the beta and noticed a huge fps drop when enabling the tk2d camera.

I created an empty scene, with a single camera and added the tk2dcamera component to it. After hitting play and testing with the tk2dcamera enabled/disabled state, I noticed a huge fps drop when it was enabled (using the absolutely unreliable internal fps counter, but still, something is happening here).

Is it expected? I asked another tk2d user that has Unity Pro and he said that the LateUpdate is taking a lot of time (around 30% in the empty scene).

I recorded the attached gif to demonstrate the behavior.

Nevertheless, loved the new camera and the pixels/meters references. Started using it right away! Already re-commited my sprite sheets to use the right size and everything is working smooth.

Thanks for the update!
Title: Re: 2D Toolkit 2.1 beta 1
Post by: unikronsoftware on July 11, 2013, 09:09:27 am
@Fausto - Of course there will be an FPS drop as its doing some calculations in there, but from 5000-3000 I would hardly consider that a "performance hit" - its like 0.1ms, and at that resolution is completely unreliable anyway :) It shouldn't really make any noticeable difference to a real game with things going on in it.
Title: Re: 2D Toolkit 2.1 beta 1
Post by: unikronsoftware on July 11, 2013, 09:10:56 am
Weird bug in the tilemap. I'm not sure how to reproduce it, but I am unable to erase some tiles on one of my layers. I can paint a new one on top of it, but when I erase that, the old one is still underneath it. It is strange because when I commit the map, the colliders for the tiles aren't being created, so it's just the mesh that is stuck in there. Any idea what could be causing this? And yes I am 100% trying to erase on the correct layer  :)

EDIT: Ok, weird. For whatever reason it created like 5 duplicate chunks alongside the "normal" one. I manually deleted them, and it's fine now. Still a bit frightening, though..

I have seen this before, but I thought it was due to some code we were testing - I'll try to reproduce this more reliably, and if you find a way to make it do this reliably let me know so I can fix it.
Title: Re: 2D Toolkit 2.1 beta 1
Post by: fsadeq on July 11, 2013, 03:40:23 pm
The only thing I can verify is that I was using the "cut" tool both times it happened.
Title: Re: 2D Toolkit 2.1 beta 1
Post by: MyNameIsDonovan on July 11, 2013, 05:59:26 pm
Unikron, it looks like lighting on tilemaps does not work atm.
And i cant use this to fix it: http://unikronsoftware.com/2dtoolkit/forum/index.php/topic,1080.msg5137.html#msg5137

Am I missing something?

Find the tk2dTileMapMeshBuilder.cs file, search for this line:
Code: [Select]
chunk.mesh.RecalculateBounds(); and add this below it:
         
Code: [Select]
chunk.mesh.RecalculateNormals ();
Thanks profanicus, you're the best. I'll add it as soon as I get home :D
Title: Re: 2D Toolkit 2.1 beta 1
Post by: TekuStudios on July 12, 2013, 05:05:04 pm
We haven't upgraded yet, but we have a question concerning the new tk2dcamera. Is it still only allowed to be set to Ortographic? We work with Unity's Perspective cameras, but your tk2camera has many improvements that could come in handy.
Title: Re: 2D Toolkit 2.1 beta 1
Post by: fsadeq on July 12, 2013, 09:54:28 pm
We haven't upgraded yet, but we have a question concerning the new tk2dcamera. Is it still only allowed to be set to Ortographic? We work with Unity's Perspective cameras, but your tk2camera has many improvements that could come in handy.

You can choose between ortho or perspective. Go ahead and upgrade and give it a shot.
Title: Re: 2D Toolkit 2.1 beta 1
Post by: fsadeq on July 13, 2013, 04:51:26 am
Weird bug in the tilemap. I'm not sure how to reproduce it, but I am unable to erase some tiles on one of my layers. I can paint a new one on top of it, but when I erase that, the old one is still underneath it. It is strange because when I commit the map, the colliders for the tiles aren't being created, so it's just the mesh that is stuck in there. Any idea what could be causing this? And yes I am 100% trying to erase on the correct layer  :)

EDIT: Ok, weird. For whatever reason it created like 5 duplicate chunks alongside the "normal" one. I manually deleted them, and it's fine now. Still a bit frightening, though..

I have seen this before, but I thought it was due to some code we were testing - I'll try to reproduce this more reliably, and if you find a way to make it do this reliably let me know so I can fix it.

Just happened to me again - not sure how to replicate. This time there were no duplicate chunks though - they were just stuck and I couldn't erase. Had to manually delete the chunk from the Render Data after committing.
Title: Re: 2D Toolkit 2.1 beta 1
Post by: unikronsoftware on July 13, 2013, 03:11:15 pm
I worked out the situations that can trigger this. It boils down to undo handling and the variety of random things that can happen as a result. I should have it fixed in the next release.
Title: Re: 2D Toolkit 2.1 beta 1
Post by: kwhittington on July 13, 2013, 11:06:21 pm
Hi I'm having an issue with tiles maps now that I've upgraded to the beta.
The TileMap tiles lost their collider data, you can still set it in the editor (e.g Box Trimmed) but it doesn't seem to be created at run time (the character is falling through the tiles).

Could this be related to the Attach Points being added and not having set them up on the tiles?

Thanks.
Title: Re: 2D Toolkit 2.1 beta 1
Post by: unikronsoftware on July 13, 2013, 11:12:37 pm
This is unlikely anything to do with attach points.
There is a known issue - in previous versions, if you don't commit and press play, everythting builds properly. In this one, there is a bug in that pressing play on an uncommitted tilemap won't create colliders. Perhaps this is the issue you're experiencing? Its been fixed and will be in the next beta.
Title: Re: 2D Toolkit 2.1 beta 1
Post by: Kirb on July 14, 2013, 12:13:16 am
Oh good; came to report that very collision issue, glad to see that it's already been taken care of. (As well as the problem of being unable to erase some tiles)
Title: Re: 2D Toolkit 2.1 beta 1
Post by: hippocoder on July 14, 2013, 02:21:51 pm
Started supporting 2D Toolkit. I think it's just so well supported. Will be buying my copy when I get round to needing it. The sprite attach stuff pushed my fat ass over the edge to migrate :)

Question though - with your tilemap stuff, can we remove tiles during play on a temporary basis - ie user wants to create dig dug? Also is there meta data somewhere for identifying what tile it is so we can just procedurally add collision?

Thanks for supporting your work - many people don't.
Title: Re: 2D Toolkit 2.1 beta 1
Post by: hemdanw on July 14, 2013, 06:20:06 pm
Hi,

This code no longer works:

screenHeight = (int)tk2dCameraScript.ScaledResolution.y;

It gives the following error:
error CS1061: Type `tk2dCamera' does not contain a definition for `ScaledResolution' and no extension method `ScaledResolution' of type `tk2dCamera' could be found (are you missing a using directive or an assembly reference?)

I could not find any mention for this in the migration guide??

Thanks,
   hemdanw
Title: Re: 2D Toolkit 2.1 beta 1
Post by: fsadeq on July 14, 2013, 08:07:59 pm
Started supporting 2D Toolkit. I think it's just so well supported. Will be buying my copy when I get round to needing it. The sprite attach stuff pushed my fat ass over the edge to migrate :)

Question though - with your tilemap stuff, can we remove tiles during play on a temporary basis - ie user wants to create dig dug? Also is there meta data somewhere for identifying what tile it is so we can just procedurally add collision?

Thanks for supporting your work - many people don't.

Not sure about removing tiles at runtime, but you definitely can identify tiles as I do this myself.
Title: Re: 2D Toolkit 2.1 beta 1
Post by: profanicus on July 14, 2013, 11:40:03 pm
Started supporting 2D Toolkit. I think it's just so well supported. Will be buying my copy when I get round to needing it. The sprite attach stuff pushed my fat ass over the edge to migrate :)

Question though - with your tilemap stuff, can we remove tiles during play on a temporary basis - ie user wants to create dig dug? Also is there meta data somewhere for identifying what tile it is so we can just procedurally add collision?

Thanks for supporting your work - many people don't.

The support on this product is fantastic, I don't know how Unikron finds time to actually do anything productive!

You can change the tile type at any given co-ordinate on any layer freely at runtime, which includes a 'clear' type. After all your changes you call 'rebuild' to recreate the mesh - I'm not sure if it rebuilds the whole layer or just the affected chunks.

You 'get' a tile by passing either X & Y grid or world space co-ordinates, and it returns the type of tile at that location. If the tile is 'clear' then you get a -1. You can then access the info for a tile, which includes some user meta data - a string, an int, a float and a prefab. A prefab will spawn automatically though this replaces the tile visual.
Title: Re: 2D Toolkit 2.1 beta 1
Post by: unikronsoftware on July 15, 2013, 12:27:02 pm
Hi,

This code no longer works:

screenHeight = (int)tk2dCameraScript.ScaledResolution.y;

It gives the following error:
error CS1061: Type `tk2dCamera' does not contain a definition for `ScaledResolution' and no extension method `ScaledResolution' of type `tk2dCamera' could be found (are you missing a using directive or an assembly reference?)

I could not find any mention for this in the migration guide??

Thanks,
   hemdanw


Hi,

Not updated the migration guide with this yet unfortunately - mainly becasue these were meant to be put back in as functions marked as obselete.
The equivalent in the new tk2dCamera is -
   [System.Obsolete] public Vector2 ScreenResolution { get { return new Vector2( ScreenExtents.xMax, ScreenExtents.yMax ); } }
You can add that code to your tk2dCamera class, the next version will have that present in it.

Title: Re: 2D Toolkit 2.1 beta 1
Post by: unikronsoftware on July 15, 2013, 12:32:19 pm
Started supporting 2D Toolkit. I think it's just so well supported. Will be buying my copy when I get round to needing it. The sprite attach stuff pushed my fat ass over the edge to migrate :)

Question though - with your tilemap stuff, can we remove tiles during play on a temporary basis - ie user wants to create dig dug? Also is there meta data somewhere for identifying what tile it is so we can just procedurally add collision?

Thanks for supporting your work - many people don't.

You can remove tiles during play, but you'd want to avoid using Unity physics on them. tk2d bakes the tilemap colliders down to a mesh collider, and those are rather expensive to rebuild. If you're using your own code to id tiles and perform collision detection on them, you should be fine with that. I.e. I'd do that if I were implementing digdug. The render mesh & collider meshes are partitioned at regular intervals, so if you touch a few tiles and call build, it will just build the changed partitions.
Title: Re: 2D Toolkit 2.1 beta 1
Post by: unikronsoftware on July 15, 2013, 12:33:09 pm
Oh good; came to report that very collision issue, glad to see that it's already been taken care of. (As well as the problem of being unable to erase some tiles)

We'll release the next beta after the undo issue is sorted out (i.e. unable to delete tiles, etc).