Hello Guest

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

orb

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: 2D Toolkit 2.2 beta 1
« Reply #15 on: August 19, 2013, 05:56:56 am »
Excellent! The layout stuff makes me very happy.

profanicus

  • 2D Toolkit
  • Full Member
  • *
  • Posts: 167
    • View Profile
Re: 2D Toolkit 2.2 beta 1
« Reply #16 on: August 19, 2013, 08:42:34 am »
Some issues with Layout:

  • First up I just want to say that it's awesome. :)
  • When adding a Container Sizer component it is not sized to take into account the pixel scale - my containers come in really tiny.
  • Sizing the Layouts when in Edit mode really screws things up and should be discouraged.
  • How about editing the Layouts numerically, set exact pixel perfect multipliers, or reset them to their original size?
  • The gizmo that sets the scale anchors, maybe we could click in the middle to toggle all/none? ATM it takes four clicks to set a common scenario.
  • Will we be able to scale textmesh? Seems text always stays the same size when I scale up the layout
  • Maybe the Layouts themselves could have a definable anchor other than just the top left. Seems a problem atm when trying to use a Container to distribute buttons evenly without scaling them - currently it doesn't work as anything not scaled is fixed to the top left of the Layout. It's almost like everything should be able to act like the Text currently does, moving rather than scaling.
  • edit: I've found changes to a layout are not being updated until you click another object in the hierarchy
« Last Edit: August 19, 2013, 09:20:34 am by profanicus »

jacky

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 40
    • View Profile
Re: 2D Toolkit 2.2 beta 1
« Reply #17 on: August 19, 2013, 11:41:43 pm »
First of all, the new layout system looks great!

One question though, is it possible to use non-tk2d elements in the layout? The first that comes to mind is the GUIText. We need the ability to display, for example, Chinese characters. This is pretty impractical with bitmap fonts.

Thanks!

profanicus

  • 2D Toolkit
  • Full Member
  • *
  • Posts: 167
    • View Profile
Re: 2D Toolkit 2.2 beta 1
« Reply #18 on: August 20, 2013, 12:23:23 am »
First of all, the new layout system looks great!

One question though, is it possible to use non-tk2d elements in the layout? The first that comes to mind is the GUIText. We need the ability to display, for example, Chinese characters. This is pretty impractical with bitmap fonts.

Thanks!

It works with gameobjects, and will position but not scale them in exactly the same way that a tk2dTextMesh currently behaves. In fact, I don't think the system really supports tk2dTextMesh at all, but positions the gameobject regardless of what component is on it (unless it's a sprite or layout) - so yes it should work with GUIText in the same way.

jacky

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 40
    • View Profile
Re: 2D Toolkit 2.2 beta 1
« Reply #19 on: August 20, 2013, 05:33:41 pm »
Quote
It works with gameobjects, and will position but not scale them in exactly the same way that a tk2dTextMesh currently behaves. In fact, I don't think the system really supports tk2dTextMesh at all, but positions the gameobject regardless of what component is on it (unless it's a sprite or layout) - so yes it should work with GUIText in the same way.

I was hoping this would be the case but I tried throwing a GUIText in and it did not move with the button. I am assuming that this has something to do with the transform. The GUIText uses a transform from 0 to 1 (with 1, 1...ignoring z) being at the bottom right(?) of the screen. I am thinking that I could create a custom class by extending GUIText and calculating the transform but I am hoping there is an easier solution that I am missing!

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: 2D Toolkit 2.2 beta 1
« Reply #20 on: August 20, 2013, 05:38:47 pm »
No, Unity GUIText is not drawn with the rest of the geometry. Its drawn by the GUILayer component on the camera, which means it can't be fit into the rest of the pipeline even if you use the correct materials.

A unity textmesh on the other hand, can be made to work by simply setting the correct shader on it.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: 2D Toolkit 2.2 beta 1
« Reply #21 on: August 20, 2013, 05:40:58 pm »
Some issues with Layout:

  • First up I just want to say that it's awesome. :)
  • When adding a Container Sizer component it is not sized to take into account the pixel scale - my containers come in really tiny.
  • Sizing the Layouts when in Edit mode really screws things up and should be discouraged.
  • How about editing the Layouts numerically, set exact pixel perfect multipliers, or reset them to their original size?
  • The gizmo that sets the scale anchors, maybe we could click in the middle to toggle all/none? ATM it takes four clicks to set a common scenario.
  • Will we be able to scale textmesh? Seems text always stays the same size when I scale up the layout
  • Maybe the Layouts themselves could have a definable anchor other than just the top left. Seems a problem atm when trying to use a Container to distribute buttons evenly without scaling them - currently it doesn't work as anything not scaled is fixed to the top left of the Layout. It's almost like everything should be able to act like the Text currently does, moving rather than scaling.
  • edit: I've found changes to a layout are not being updated until you click another object in the hierarchy


Sizing the layouts in edit mode is sometimes necessary - eg to reposition the layout object relative to the children.
The main problem with anything pixel based is, how do you decide what units to use?

jacky

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 40
    • View Profile
Re: 2D Toolkit 2.2 beta 1
« Reply #22 on: August 20, 2013, 06:13:19 pm »
Ouch. I was worried that might be the case! This is quite a dealbreaker for apps that need to be localized in languages such as Chinese. I saw an old post with talk of using packed fonts. Even doing it that way you would still have to have a quite a few textures to hold all of the characters in the Chinese language!

Any suggestions on how to use tk2d with languages like this? Is it even possible? I love what you have done with the layouts and I would love to be able to use it in all of my apps!

Thanks again for the amazing product and support!!
« Last Edit: August 20, 2013, 06:56:54 pm by jacky »

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: 2D Toolkit 2.2 beta 1
« Reply #23 on: August 20, 2013, 07:06:21 pm »
Ouch. I was worried that might be the case! This is quite a dealbreaker for apps that need to be localized in languages such as Chinese. I saw an old post with talk of using packed fonts. Even doing it that way you would still have to have a quite a few textures to hold all of the characters in the Chinese language!

Any suggestions on how to use tk2d with languages like this? Is it even possible? I love what you have done with the layouts and I would love to be able to use it in all of my apps!

Thanks again for the amazing product and support!!

But the Unity text mesh (not tk2d text mesh) will work with this. Doesn't that play well with dynamic fonts?

profanicus

  • 2D Toolkit
  • Full Member
  • *
  • Posts: 167
    • View Profile
Re: 2D Toolkit 2.2 beta 1
« Reply #24 on: August 21, 2013, 12:04:08 am »
I've played some more and most of my problems came from trying to use layout for something it wasn't really designed for. What I was trying to do was use the Layout Container Sizer purely as a tool to distribute child objects evenly within an area. It almost worked. :)

Izitmee

  • 2D Toolkit
  • Jr. Member
  • *
  • Posts: 99
    • View Profile
    • Holoville Games
Re: 2D Toolkit 2.2 beta 1
« Reply #25 on: August 21, 2013, 12:40:29 pm »
Just a small feedback. I would suggest letting the camera being set with "forced resolution" at false by default, which is the default setting with previous versions I suppose? I had to go through all scenes of my project and let the new camera update after having set it myself (and after finding myself scared by the camera stretching instead than staying pixel perfect as I had it :D)

EDIT: ooops, sorry, this comment was meant for v2.1

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: 2D Toolkit 2.2 beta 1
« Reply #26 on: August 21, 2013, 07:40:34 pm »
Hey. The new camera setting simply uses your game window resolution by default. So if you want to preview as it'll draw on an iPhone4, pick an iPhone4 resolution in game window and thats all you need to do. With the old system you had to override it, etc, but now it really isn't necessary, just set your game window to what you want to preview at.
Would that work for you?

Izitmee

  • 2D Toolkit
  • Jr. Member
  • *
  • Posts: 99
    • View Profile
    • Holoville Games
Re: 2D Toolkit 2.2 beta 1
« Reply #27 on: August 21, 2013, 10:19:25 pm »
It works great! And actually to get back to pixel-perfect I just had to uncheck "forced resolution" :) By the way, the new camera inspector and functions are really cool!

jacky

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 40
    • View Profile
Re: 2D Toolkit 2.2 beta 1
« Reply #28 on: August 22, 2013, 01:49:54 am »
Quote
But the Unity text mesh (not tk2d text mesh) will work with this. Doesn't that play well with dynamic fonts?

Sorry, I have not had a chance to work on this too much. I tried putting a TextMesh into the layout but the text was extremely pixelated. It could be an issue with something that I did but I had some other things come up so I haven't had a chance to work on it too much. I will update when I back to it! Thanks!

beardkey

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: 2D Toolkit 2.2 beta 1
« Reply #29 on: August 22, 2013, 04:13:33 am »
I just installed 2.2 beta (on unity 4.1.5f1) and am running in to some odd behavior. I have one scene that uses a tk2d camera, with a tk2d uiManager script attached. When I play and move to a different scene the camera follows through as if marked as DontDestroyOnLoad().

If I create a generic camera and set it up like in the UI Getting Started doc, I have no such problem.

Am I doing something obvious, or should I no longer be using the 2dtk camera I had set up before?

Edit: Another oddity - following the Advanced UI Layout doc, after playing with 5 buttons I started trying out different proportions. I'm finding that half the time I try it begins to offset the button texture and text oddly, and I'm unable to hit R to reset it unless I delete that game object.

It seems to only happen when I clear the Proportion by hitting backspace all the way before typing a new number, rather than just highlighting it and replacing. Example can be seen here.
« Last Edit: August 22, 2013, 04:47:25 am by beardkey »