Hello Guest

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

gary-unikronsoftware

  • 2D Toolkit
  • Jr. Member
  • *
  • Posts: 74
    • View Profile
Re: 2D Toolkit 2.2 beta 1
« Reply #45 on: August 27, 2013, 04:00:56 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

I have managed to recreate the problem and it would appear that when you hit backspace to change the proportion number, it treats this as a zero and sizes the button accordingly but causes some of button information to be set incorrectly.  Then when you enter a correct proportion value, it tries to calculate the size and position but because some of the information is correct now, it doesn't work properly.  A quick fix for this is to not allow any zero proportion values, so in the file tk2dUILayoutContainerSizer.cs, partway through the function there should be this code:

Code: [Select]
for (int i = 0; i < n; ++i) {
var item = layoutItems[i];
if (!item.fixedSize && item.fillPercentage <= 0) {
childSize[i] = space * item.sizeProportion / proportionSum;
}
}

If you change it to this:

Code: [Select]
for (int i = 0; i < n; ++i) {
var item = layoutItems[i];
if (!item.fixedSize && item.fillPercentage <= 0) {
childSize[i] = space * item.sizeProportion / proportionSum;
}

if(Mathf.Approximately(childSize[i], 0.0f) || childSize[i] < 0.0f) return;
}

That should provide a temp fix until it is fixed in the next release.

beardkey

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: 2D Toolkit 2.2 beta 1
« Reply #46 on: August 27, 2013, 08:26:43 pm »
To both the font fix and the code fix, looks like that works for now, thanks! Since I've been such a debbie downer, let me just say everything else looks great and promising. One suggestion - in the UILayout component, a way to set the button's stretch geometry (whatever you want to call that, the green box with I marks around it) to all would be handy, but not necessary. I can live with four clicks.

As to the font issue - it looks like for me it was broken at some point during my Git commit/push/pull. At least I know where to go to fix it now, thanks!

Edit: Ah-hah moment. I was close, it's not quite the camera. We're also using SmoothMoves and, up until this update I had been using a standard Orthographic camera. Due to the native size of our SmoothMoves characters, we had been scaling everything else accordingly, so our camera is at a scale of 480. Similarly, I scaled up the buttons by 400 in the Transform in order to appropriately have them displayed. If I just dragged them to size, the text would remain too small.

Apparently, this is a no-no and is what is causing all of my major layout issues. Working with things at a scale of 1 is great, but even at a scale of 10 I start seeing issues with the buttons overlapping eachother and not moving around / adjusting properly.

Should I instead be working at a scale of 1 for the camera and downsizing all of our SmoothMoves animations and characters? Or is there something I can do to get the tk2d items to work at the higher scale?
« Last Edit: August 27, 2013, 08:56:47 pm by beardkey »

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: 2D Toolkit 2.2 beta 1
« Reply #47 on: August 28, 2013, 10:29:24 am »
This has never been tested with scale != 1, so I'm guessing this is "expected".
I'll investigate that.

You can use separate cameras for your smooth moves / tk2d sprites. That might make things easier as you wont have to work to constraints of one or the other. Check the UI sample (the one with 3d UI) on how to set this up.

fattie

  • 2D Toolkit
  • Full Member
  • *
  • Posts: 106
    • View Profile
Re: 2D Toolkit 2.2 beta 1
« Reply #48 on: August 29, 2013, 10:13:49 am »
Regarding 3GS.  Yeah it DOES SEEM TO WORK with 2048.  I find the sprite size limitations very confusing on iPhone, and hard to find real information on.  Because bizarrely .. it even seems to work with 4096 (!) Perhaps in the pipeline it chops it down and does something really slow if you (foolishly, as it were) use textures that are too big.

Regarding "should you target 3GS" personally I say "No."  But for a client with 1m players on a game, tragically, yeah, some 100,000s end users still have a frikkin' 3GS.  It's worth noting that YOUNGER AUDIENCE often has crappier older devices -- it's obvious when you think about it.  (They get Mom's old phone - that sort of thing.)

  • Default sprite collection size is now 2048. 1024 is no longer a sensible minimum. No one targets iPhone3G anymore, right?

Hmm I thought people still targeted the 3GS as it uses iOS6 (and has a 1024 max texture size). Or am I wasting my time supporting it?

Isn't iPhone3GS max texture size 2048? Its got pretty much the same gfx chip as the iPhone4 in it. I haven't got a device handy, but all the benchmarks I can find online say max texture size on 3GS = 2048. Am I mistaken?

fattie

  • 2D Toolkit
  • Full Member
  • *
  • Posts: 106
    • View Profile
Re: 2D Toolkit 2.2 beta 1
« Reply #49 on: August 29, 2013, 11:46:50 am »
Regarding TILEMAP ...

I just tried importing 2.2b1 into a fresh new blank project.

In fact, I unselected TileMap (and UI) as I am not using them.

Actually, it doesn't work --

for example tk2dEditorUtility OnUndoRedo() references TileMap.


I'm thinking, would it be better if one could cleanly not install TileMap / UI ?

Cheers Fattie

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: 2D Toolkit 2.2 beta 1
« Reply #50 on: August 31, 2013, 12:01:03 pm »
Yup I'll remove that dependency before the next release.

orb

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: 2D Toolkit 2.2 beta 1
« Reply #51 on: September 05, 2013, 10:07:17 pm »
I've been using this beta for a while now, and it's been working pretty well apart from one thing. I can't get render layers to actually depth sort the sprites at all! Things will pretty much remain in the order they feel like, with all sprites sorted to Z=0. This is in Unity 4.2 on OS X.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: 2D Toolkit 2.2 beta 1
« Reply #52 on: September 06, 2013, 01:42:22 pm »
Are you using a perspective camera? If you can reproduce that reliably, drop me an email at support at unikronsoftware dot com with a simple repro case and I'll investigate.

vicenterusso

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 25
    • View Profile
Re: 2D Toolkit 2.2 beta 1
« Reply #53 on: September 07, 2013, 12:56:33 am »
Sorry if wrong thread  :-[

I want to know what version I'm using right know.. anywhere in the code says the version?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: 2D Toolkit 2.2 beta 1
« Reply #54 on: September 07, 2013, 09:17:12 am »
2D Toolkit > About. Create a new thread in the support / private support forum if it isn't about this beta though.

fattie

  • 2D Toolkit
  • Full Member
  • *
  • Posts: 106
    • View Profile
Re: 2D Toolkit 2.2 beta 1
« Reply #55 on: September 07, 2013, 11:58:24 am »
Unikron dudes --

I'm thinking, just a simple one it would be great if you could put ALL the DEMO material,

under ONE folder.

(A detail, if you also throw the PDF / etc in there.)

That would be GREAT .. for the reason that when you import using Unity's process, you could turn off importing the DEMO material decisively with one click.

That would be great!

orb

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: 2D Toolkit 2.2 beta 1
« Reply #56 on: September 07, 2013, 01:28:08 pm »
Are you using a perspective camera? If you can reproduce that reliably, drop me an email at support at unikronsoftware dot com with a simple repro case and I'll investigate.
Orthographic only. I've made some workarounds that work for me, although they're not clean. I'll see if I can build it reliably and send you a project :)

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: 2D Toolkit 2.2 beta 1
« Reply #57 on: September 09, 2013, 02:35:57 pm »
Unikron dudes --

I'm thinking, just a simple one it would be great if you could put ALL the DEMO material,

under ONE folder.

(A detail, if you also throw the PDF / etc in there.)

That would be GREAT .. for the reason that when you import using Unity's process, you could turn off importing the DEMO material decisively with one click.

That would be great!

Hello - is the source only version not sufficient for your needs? I'm slightly reluctant to move things around - as you probably know moving things around and importing into a Unity project can result in some pretty disasterous results, especially if the users metadata is already broken...

fattie

  • 2D Toolkit
  • Full Member
  • *
  • Posts: 106
    • View Profile
Re: 2D Toolkit 2.2 beta 1
« Reply #58 on: September 15, 2013, 02:46:02 pm »
You're right, moving things around is hell.  So true.

But what about this ONE relatively modest - and worthwhile - change.

Simply, make a new folder at the top with a big name like "ALL DEMO MATERIAL IN HERE ONLY FOREVER /"

from then on,

every and all demos, manuals, notes, readmes, PDFs, etc would be in that folder.

this would be incredibly handy.

Note that the only downside is, it could be that someone leaves hanging around some particular demo file, in the "old" location and also in the new ultra-demo-folder location.

It's kind of like this event ...

http://en.wikipedia.org/wiki/Dagen_H

... the sooner it's done the better  :)

It's an interesting observation that you probably never have to do this, but every single time I update I spend 20 minutes swearing about trying to find all the damn demo files  :)  Is it safe to delete this png?  what's this?  etc etc.  (recall that the stupid interface in Unity does not "stagger out" folders correctly so there's really no clue what's happening anyway.)

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: 2D Toolkit 2.2 beta 1
« Reply #59 on: September 15, 2013, 09:41:46 pm »
Moving the demo folder around will cause a lot of issues. It might be easier for me to batch a new package without demos altogether, but that will pretty much get rid of all the UI components... Something to think about at least.