Hello Guest

Author Topic: 2D Toolkit 2.2 beta 1  (Read 76019 times)

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: 2D Toolkit 2.2 beta 1
« Reply #30 on: August 22, 2013, 10:17:24 am »
@beardkey -

1. You attach the tk2dUIManager script to the camera? You shouldn't if you're doing that - the tk2dUIManager is meant to be persistent, but the camera isn't. Create a UI manager separately to the camera.

2. Can you give me steps on how to reproduce this in the demo? I'm not able to reproduce this. Thanks!

srivello

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: 2D Toolkit 2.2 beta 1
« Reply #31 on: August 22, 2013, 01:20:32 pm »
Hi! I'm loving tk2dTileMap and excited for the next public release. I'm using this beta and have an architectural question.

I'd like to lock a camera to a spiral shape made of tiles. At runtime I'd like left/right to rotate the spiral shape (as one unit) and have a player which falls with physics. The user will rotate the spiral to guide the falling player to the center of the spiral.

QUESTION
1. What is the best setup for this? 2k2DTileMap (with colliders in the sprite collection) for the spiral and 2k2dsprite (with box collider and rigidbody)?
2. Or a  layer within 2k2DTileMap (with colliders in the sprite collection) for the spiral and 2k2dsprite (with box collider and rigidbody)?

beardkey

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: 2D Toolkit 2.2 beta 1
« Reply #32 on: August 22, 2013, 01:43:04 pm »
1) I had been using the same camera I set up when going through the 2.1 instructions, which had me set up the UI Manager and I just threw it on the Camera for ease of use. It had worked no problem until the update. Knowing now that it will stay persistent I'll try to figure this out. I'm not sure how though since I need to drag a reference to the main camera in each scene. I'm probably just missing something, I'll toy around with it a bit after work today.

2) It's odd, I can't directly reproduce it with anything that's in the UI Layout Demo scene consistently. For instance if I try using the DistributedButtons that are already set up, it happens only once in every 15 times I load the scene, and only if I set them to Vertical so far. HOWEVER, here are steps that get it to happen every time.

  • Load the UI Layout Demo scene
  • Add empty game object to the scene with GameObject -> Create Empty
  • Component -> 2D Toolkit -> UI -> Core -> Tk2dUILayoutContainerSizer
  • Drag four Buttons from the ControlPrefabs/Layout folder on to the GameObject
  • Select the GameObject and hit the Proportional button
  • In the Items list, select BasicButton 3
  • Click in the Proportion field, hit backspace and type in a '3'
  • Disable the LayoutDemo game object if you want to see it better

Following those steps exactly, each time, give me this result

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: 2D Toolkit 2.2 beta 1
« Reply #33 on: August 22, 2013, 02:03:10 pm »
Hi! I'm loving tk2dTileMap and excited for the next public release. I'm using this beta and have an architectural question.

I'd like to lock a camera to a spiral shape made of tiles. At runtime I'd like left/right to rotate the spiral shape (as one unit) and have a player which falls with physics. The user will rotate the spiral to guide the falling player to the center of the spiral.

QUESTION
1. What is the best setup for this? 2k2DTileMap (with colliders in the sprite collection) for the spiral and 2k2dsprite (with box collider and rigidbody)?
2. Or a  layer within 2k2DTileMap (with colliders in the sprite collection) for the spiral and 2k2dsprite (with box collider and rigidbody)?

If I understand this properly, I think the best option is to keep the tile map static and move gravity / addforce to the rigidbody to simulate changing gravity based on rotation. Obviously you should rotate the camera with the direction to make it seem like the whole world is rotating.
It'll be much more efficient than moving the tiles.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: 2D Toolkit 2.2 beta 1
« Reply #34 on: August 22, 2013, 02:05:34 pm »
1) I had been using the same camera I set up when going through the 2.1 instructions, which had me set up the UI Manager and I just threw it on the Camera for ease of use. It had worked no problem until the update. Knowing now that it will stay persistent I'll try to figure this out. I'm not sure how though since I need to drag a reference to the main camera in each scene. I'm probably just missing something, I'll toy around with it a bit after work today.

2) It's odd, I can't directly reproduce it with anything that's in the UI Layout Demo scene consistently. For instance if I try using the DistributedButtons that are already set up, it happens only once in every 15 times I load the scene, and only if I set them to Vertical so far. HOWEVER, here are steps that get it to happen every time.

  • Load the UI Layout Demo scene
  • Add empty game object to the scene with GameObject -> Create Empty
  • Component -> 2D Toolkit -> UI -> Core -> Tk2dUILayoutContainerSizer
  • Drag four Buttons from the ControlPrefabs/Layout folder on to the GameObject
  • Select the GameObject and hit the Proportional button
  • In the Items list, select BasicButton 3
  • Click in the Proportion field, hit backspace and type in a '3'
  • Disable the LayoutDemo game object if you want to see it better

Following those steps exactly, each time, give me this result

1. We changed the behaviour of UI Manager to decouple it from the camera allowing multiple cameras, and making it easier to switch scenes - and while the new approach is backwards compatible to previous setup, I didn't anticipate anyone attaching the UIManager to the camera ;) Anyway, with 2.2 (the 2.2 docs have been updated to reflect this), you attach a tk2dUICamera script to every camera that is to be considered for the UI. If you don't need to set up any custom properties on the UIManager, you don't even need to create one.

And thanks for #2 - I'll investigate this.

Izitmee

  • 2D Toolkit
  • Jr. Member
  • *
  • Posts: 99
    • View Profile
    • Holoville Games
Re: 2D Toolkit 2.2 beta 1
« Reply #35 on: August 25, 2013, 09:37:35 am »
Hi,

just a note. I updated to v2.2beta because v2.1 had made Unity unstable (I'm not sure why, but now everything seems to be ok again). Only problem I found, is that "force resolution" was not remembered on my tk2dCameras, and I had to uncheck it again.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: 2D Toolkit 2.2 beta 1
« Reply #36 on: August 26, 2013, 02:21:54 pm »
I'll check this out - will sort it out for then next release.

Izitmee

  • 2D Toolkit
  • Jr. Member
  • *
  • Posts: 99
    • View Profile
    • Holoville Games
Re: 2D Toolkit 2.2 beta 1
« Reply #37 on: August 26, 2013, 02:31:00 pm »
By the way, even with 2.2 Unity (4.2) is still kind of unstable, even if less than with 2.1. I don't know if it's just a coincidence and something else happened that corrupted Unity, but it started immediately after I updated 2D Toolkit (which anyway is awesome - I have to repeat this now and then :D)

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: 2D Toolkit 2.2 beta 1
« Reply #38 on: August 26, 2013, 02:38:58 pm »
It shouldn't have changed anything substantial - unstable how? Just random crashes?

Izitmee

  • 2D Toolkit
  • Jr. Member
  • *
  • Posts: 99
    • View Profile
    • Holoville Games
Re: 2D Toolkit 2.2 beta 1
« Reply #39 on: August 26, 2013, 06:33:47 pm »
Random crashes when pressing PLAY or STOP in the editor.

beardkey

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: 2D Toolkit 2.2 beta 1
« Reply #40 on: August 27, 2013, 05:40:56 am »
Hate to say it but I'm going to have to pass on this for a while. I've spent way too much time with the layouts, and they're just acting funky (clicking on different items in the Items list causing buttons to shift in the scene for instance). I'm wondering if it's because I have a camera size of 480 and have to scale buttons up, since that seems to be the only real difference between the working examples and what I have going. Maybe I'm just cursed. I've been trying to get things to work and suddenly the fonts on the buttons in the demo scene look like this with any font I choose... I think that's an omen to give up till next release.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: 2D Toolkit 2.2 beta 1
« Reply #41 on: August 27, 2013, 12:04:03 pm »
The fonts doing that is nothing to do with the layouts actually - I'm pretty sure I know what that is. Open up the sprite collection editor and look at this. Make sure the font slot isn't null, and commit the sprite collection.

That one parameter does some weird stuff when upgrading Unity, I've had it lose the reference a few times for no apparent reason.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: 2D Toolkit 2.2 beta 1
« Reply #42 on: August 27, 2013, 12:07:46 pm »
Random crashes when pressing PLAY or STOP in the editor.

Hmm bizarre, can't say I've seen anything like that. Anything special in the scene? Any spew in the editor log after the crash?

Izitmee

  • 2D Toolkit
  • Jr. Member
  • *
  • Posts: 99
    • View Profile
    • Holoville Games
Re: 2D Toolkit 2.2 beta 1
« Reply #43 on: August 27, 2013, 12:24:14 pm »
Hmm bizarre, can't say I've seen anything like that. Anything special in the scene? Any spew in the editor log after the crash?

Nope, Unity simply freezes and I have to force close it.

The scene contains an interface made with 2D Toolkit cameras and anchors (but no tk2dUI), my pooling system, tweens of various kinds, and regular 3D objects, and it's the same scene I work on since months (since it randomly generates content).

Again, it's quite bizarre indeed, and something might've happened unrelated to 2D Toolkit (I mean, that was the only asset/big-chunk-of-code I updated before this started happening almost immediately after, but still, Unity sometimes is strange). And Unity freezes a lot less since updating from 2.1 to 2.2.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: 2D Toolkit 2.2 beta 1
« Reply #44 on: August 27, 2013, 12:39:15 pm »
That makes it even weirder.
Nothing substantial has changed between 2.1 -> 2.2 with any of that stuff you're using.