Hello Guest

Author Topic: 2D Toolkit 2.1 beta 1  (Read 64669 times)

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: 2D Toolkit 2.1 beta 1
« Reply #45 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.

Kirb

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 36
    • View Profile
Re: 2D Toolkit 2.1 beta 1
« Reply #46 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)

hippocoder

  • Guest
Re: 2D Toolkit 2.1 beta 1
« Reply #47 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.

hemdanw

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: 2D Toolkit 2.1 beta 1
« Reply #48 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

fsadeq

  • 2D Toolkit
  • Sr. Member
  • *
  • Posts: 353
    • View Profile
Re: 2D Toolkit 2.1 beta 1
« Reply #49 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.

profanicus

  • 2D Toolkit
  • Full Member
  • *
  • Posts: 167
    • View Profile
Re: 2D Toolkit 2.1 beta 1
« Reply #50 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.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: 2D Toolkit 2.1 beta 1
« Reply #51 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.


unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: 2D Toolkit 2.1 beta 1
« Reply #52 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.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: 2D Toolkit 2.1 beta 1
« Reply #53 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).