2D Toolkit Forum

2D Toolkit => Releases => Topic started by: unikronsoftware on April 19, 2013, 12:36:41 pm

Title: 2D Toolkit UI 1.0 beta 3
Post by: unikronsoftware on April 19, 2013, 12:36:41 pm
IMPORTANT: This version is not guaranteed to be backwards compatible with the alpha release. Most class names have changed. If you have started work with the alpha version, follow the instructions the beta 2 post to upgrade before proceeding.

This version is backwards compatible with beta 2.


Webplayer demo here (http://www.unikronsoftware.com/2dtoolkit/webplayer/uidemo/)

Features:
- Light weight code, ultra fast.
- Lots of control prefabs. Use as a basis for customization, or create your own.
Buttons
Checkboxes
Radio Buttons
Textboxes
Lists
Sliders
Progress bars
Scrollbars
Scrolling areas
- Multi touch support, including on screen keyboard on iOS / Android
- Full mobile / webplayer / PC / Mac support. Almost full Flash support.
- Works in Unity Free & Pro

Bugfixes and improvements:
- Works in Flash, apart from text input. This is a known issue with Unity.
- UIDropDown now has a helper to help set up heights.
- Scrollbar, arrow buttons mirror mouse operations - held down for duration of mouse click.
- Esc/tab entering incorrect input on Mac only (known Unity issue).
- Dismiss on screen keyboard by clicking outside the view
- Scrollbar, when dragging thumb, the arrows aren't highlighted.
- UIControlsHelper works when scaled
- Scrollable area depth masks are now sliced sprites (easily scaled)
- Scrollbar "bar" is a sliced sprite.
- tk2dUIItem doesn't require a collider any more, sphere colliders can be set up.
- textinput password option with configureable character.
- fixed bug where clicking on the next textinput (on mobile) will enter text in both.
- scrollable area option to set value without event.
- in scrollable area, when setting content length programatically, if content length < visible length, scrollbar is hidden.
- tk2dUI prefix on all classes (finalized)
- tk2dUITime is now a static class
- scrollable area snapback uses velocity
- click + hold scrollbar arrow to scroll continuously
- now possible to change toggle buttons at runtime
- scrollbar editor widget corrected and shows thumb size
- editor widgets show extended line when being used, easier to position and tweak correctly.
Title: Re: 2D Toolkit UI 1.0 beta 3
Post by: DannyB on April 19, 2013, 12:45:40 pm
This is cool.

Will it be compatible with both Unity 3.5 and 4.x?
Title: Re: 2D Toolkit UI 1.0 beta 3
Post by: unikronsoftware on April 19, 2013, 12:52:13 pm
Yes.
Title: Re: 2D Toolkit UI 1.0 beta 3
Post by: mike2d on April 19, 2013, 02:06:59 pm
really nice work !

will this be included in the package or is it a seperate purchase ?
Title: Re: 2D Toolkit UI 1.0 beta 3
Post by: unikronsoftware on April 19, 2013, 02:15:07 pm
@mike2d you've got pm :)
Title: Re: 2D Toolkit UI 1.0 beta 3
Post by: Dgizusse on April 19, 2013, 03:04:17 pm
Updated from beta 2 using Unity 3.5.7

Works flawlessly!

Very nice job once again.
Title: Re: 2D Toolkit UI 1.0 beta 3
Post by: mike2d on April 19, 2013, 04:25:09 pm
thanks :D
Title: Re: 2D Toolkit UI 1.0 beta 3
Post by: AppleGuy on April 21, 2013, 05:42:17 am
My scrollable area does not seem to be receiving any touch events.

This is what I did.

1. The UI Camera of tk2DUIManager is pointing to my existing tk2DCamera of my current project.
2. As per instruction in the PDF for scrollable area, I created the scrollable area including the camera and layer.

I can see the scrollable area but unable to scroll it.  Please advise.  Thanks.

Will you consider having prefabs that can work with current tk2dcamera instead of a separate camera?
Title: Re: 2D Toolkit UI 1.0 beta 3
Post by: DannyB on April 21, 2013, 08:13:17 am
Will you consider having prefabs that can work with current tk2dcamera instead of a separate camera?
I also like the option of working with one camera.
Title: Re: 2D Toolkit UI 1.0 beta 3
Post by: unikronsoftware on April 21, 2013, 11:36:35 pm
It does work, just that it needs the sprites built for that resolution. Obviously then the sizes of things will be different, but I guess you're changing the dimensions of things when you customize anyway, aren't you? I have a script that will rescale appropriately when switching sprite collection, but I'm not sure its worth including in the system as its a bit rough around the edges...
Title: Re: 2D Toolkit UI 1.0 beta 3
Post by: AppleGuy on April 22, 2013, 07:35:54 am
It does work, just that it needs the sprites built for that resolution. Obviously then the sizes of things will be different, but I guess you're changing the dimensions of things when you customize anyway, aren't you? I have a script that will rescale appropriately when switching sprite collection, but I'm not sure its worth including in the system as its a bit rough around the edges...

I am unable to scroll the scrollable area though I can see it visible on screen.
Title: Re: 2D Toolkit UI 1.0 beta 3
Post by: Logon on April 22, 2013, 10:06:26 am
Really nice work!
Used this for my main menu plus inventory screen and it works like a charm.

will this be included in the package or is it a seperate purchase ?

I would also like to know this.
Title: Re: 2D Toolkit UI 1.0 beta 3
Post by: unikronsoftware on April 22, 2013, 10:21:35 am
It does work, just that it needs the sprites built for that resolution. Obviously then the sizes of things will be different, but I guess you're changing the dimensions of things when you customize anyway, aren't you? I have a script that will rescale appropriately when switching sprite collection, but I'm not sure its worth including in the system as its a bit rough around the edges...

I am unable to scroll the scrollable area though I can see it visible on screen.

That should definitely work - I've used it in a project with tk2dCamera set on the sprite collection and also on a perspective camera. Did you simply drag in the prefab and configure from there, or did you set it up yourself?
Title: Re: 2D Toolkit UI 1.0 beta 3
Post by: AppleGuy on April 22, 2013, 10:30:22 am

That should definitely work - I've used it in a project with tk2dCamera set on the sprite collection and also on a perspective camera. Did you simply drag in the prefab and configure from there, or did you set it up yourself?

I dragged in the prefab.  Set the scrollable area to a scrollable camera.  However, my UI camera for the tk2duimanager is pointing to my existing tk2dcamera instead of another camera and it has a orthographic size of 480.  Will that be an issue?
Title: Re: 2D Toolkit UI 1.0 beta 3
Post by: unikronsoftware on April 22, 2013, 10:32:46 am
The UIcamera has to be the camera that "sees" the GUI, whichever that may be.
Title: Re: 2D Toolkit UI 1.0 beta 3
Post by: AppleGuy on April 22, 2013, 11:59:02 am
The UIcamera has to be the camera that "sees" the GUI, whichever that may be.

The camera that sees the UI is the scrollable camera but it still does not receive touch events.
Title: Re: 2D Toolkit UI 1.0 beta 3
Post by: unikronsoftware on April 22, 2013, 12:28:16 pm
I'll investigate that.
Edit: Just tested it and it definitely works fine. If you're still stuck can you send me a repro case to support@unikronsoftware.com? Probably be a lot easier to just work it out from there.
Title: Re: 2D Toolkit UI 1.0 beta 3
Post by: AppleGuy on April 22, 2013, 02:40:04 pm
Finally got it to work!  I have accidentally set my raycast layer mask to only that of the scrollable area layer.

Thanks a lot for your help.  =)
Title: Re: 2D Toolkit UI 1.0 beta 3
Post by: AppleGuy on April 23, 2013, 11:37:32 am
Is it possible to automatically set the content height of the scrollable area to the height of the text mesh?  I have a text mesh that has varying height depending on the actual text fetched from the server.
Title: Re: 2D Toolkit UI 1.0 beta 3
Post by: unikronsoftware on April 23, 2013, 07:18:32 pm
Not directly in the first version. You can do it quite easily with something like this:
Code: [Select]
textMesh.text = text;
textMesh.Commit();
float h = textMesh.GetComponent<MeshFilter>().sharedMesh.bounds.size.y;
scrollableArea.contentLength = h + 40; // add some padding
Title: Re: 2D Toolkit UI 1.0 beta 3
Post by: AppleGuy on April 23, 2013, 11:40:38 pm
That doesn't seem to give me the right height.  I am expecting a height of between 1-2 but it is giving me a very large value.
Title: Re: 2D Toolkit UI 1.0 beta 3
Post by: sokolwow on April 24, 2013, 07:45:31 pm
Hi. I have found a bug. If I set scroll axes to "Y Axis" for Scrollable area and scrollbar, then content moves correctly. But if i set scroll axes to "XAxis" then content moves in one direction with slider (see image).
Sorry for my english.
Title: Re: 2D Toolkit UI 1.0 beta 3
Post by: unikronsoftware on April 26, 2013, 09:56:42 am
Thanks for the bugreports. I'll investigate and sort these out for the next release.
Title: Re: 2D Toolkit UI 1.0 beta 3
Post by: n1ngimi on April 26, 2013, 12:51:42 pm
Do you have plans to add the snap?  for ScrollList.
need a snapping ITEM.

but current scroll is no item system..
any idea?
Title: Re: 2D Toolkit UI 1.0 beta 3
Post by: unikronsoftware on April 26, 2013, 12:56:05 pm
There is no concept of "item" in the scroll list at the moment. Snapping won't be implemented until that is done. We won't be adding any new features until 1.0 final is out, so this won't be implemented until then. However, you do have full source code - adding this shouldn't be too hard, especially if your items are all fixed size.
Title: Re: 2D Toolkit UI 1.0 beta 3
Post by: Kea on April 27, 2013, 04:21:06 pm
Please add OnTextChange event to TextInput control.
Title: Re: 2D Toolkit UI 1.0 beta 3
Post by: Dgizusse on April 27, 2013, 04:47:58 pm
When removing the Send Message Target of an UIItem, if the Method Name isn't removed as well, the following message will be written to the console:
Code: [Select]
UnassignedReferenceException: The variable sendMessageTarget of 'tk2dUIItem' has not been assigned.
You probably need to assign the sendMessageTarget variable of the tk2dUIItem script in the inspector.

I'd recommend that the CustomEditor clear the Method Names whenever the Target is set back to null.
Or check that the target != null at runtime...

Thanks a lot.
Title: Re: 2D Toolkit UI 1.0 beta 3
Post by: Logon on April 27, 2013, 09:15:14 pm
It looks like the UI and iTween does not work together because it doesn't move the button at all but if i assign the localpos manually it moves, but not through itween.
Title: Re: 2D Toolkit UI 1.0 beta 3
Post by: unikronsoftware on April 27, 2013, 09:39:12 pm
@Logon - it should work fine, there isn't anything special about the buttons or any other GUI stuff, they are standard Unity game objects. I can say it works fine with HOTween, as that is what I tend to use for my PC / Mac stuff.
Title: Re: 2D Toolkit UI 1.0 beta 3
Post by: willrmiller on April 28, 2013, 11:40:30 pm
I'm having a little trouble importing this new version.  I get a "Couldn't decompress package" error.  Beta 2 imported just fine.  Is this happening to anyone else?
Title: Re: 2D Toolkit UI 1.0 beta 3
Post by: unikronsoftware on April 28, 2013, 11:59:27 pm
All attachments were broken when switching to the new server :(
I've fixed all of them now (I hope), but you will have to force your browser to update cache to download the correct version.
Title: Re: 2D Toolkit UI 1.0 beta 3
Post by: Code on April 29, 2013, 02:23:08 pm
So will the final be included in 2d toolkit? :D
Title: Re: 2D Toolkit UI 1.0 beta 3
Post by: spacejaguar on May 01, 2013, 05:22:06 pm
Unity has a bug were if you disable the preview line above the keyboard when entering text on Android, you will be unable to use the delete key.
Just to let you know, I had the very same problem some weeks ago before using your UI solution. After I tried 2D Toolokit UI it i can see the same problem occurs. So in that case you must set: TouchScreenKeyboard.hideInput = false;

Is there a way to disable the resizing of the Android Game View when the keyboard appears on screen?Android decreases the entire size of the game Scene so that it fits the area view above the keyboard. It would be great if the keyboard would simply overlay the scene. I haven't found a solution for this yet. On iOS this does not happend.
Title: Re: 2D Toolkit UI 1.0 beta 3
Post by: unikronsoftware on May 01, 2013, 10:36:59 pm
Unity has a bug were if you disable the preview line above the keyboard when entering text on Android, you will be unable to use the delete key.
Just to let you know, I had the very same problem some weeks ago before using your UI solution. After I tried 2D Toolokit UI it i can see the same problem occurs. So in that case you must set: TouchScreenKeyboard.hideInput = false;

Is there a way to disable the resizing of the Android Game View when the keyboard appears on screen?Android decreases the entire size of the game Scene so that it fits the area view above the keyboard. It would be great if the keyboard would simply overlay the scene. I haven't found a solution for this yet. On iOS this does not happend.

Thanks for letting me know.

I don't know about resizing the game view on Android as far as I can tell it didn't do it on the Nexus7 I tested on - I just remember it overlaying the screen.
Title: Re: 2D Toolkit UI 1.0 beta 3
Post by: spacejaguar on May 02, 2013, 10:08:38 pm
I haven't tested it on another Android device. Galaxy Nexus here.
It has nothing to do with with 2D Toolkit UI. If you call the keyboard using the unity commands this situation will always happen.
Example:

(http://i42.tinypic.com/win4gw.png)
Title: Re: 2D Toolkit UI 1.0 beta 3
Post by: unikronsoftware on May 02, 2013, 11:08:13 pm
I can't think of a platform agnostic way of sorting that out automatically, it is bound to be different, with different keyboards you could potentially install on Android ...
Title: Re: 2D Toolkit UI 1.0 beta 3
Post by: fsadeq on May 03, 2013, 03:17:25 am
Does it make more sense to use this for on-screen touch control buttons, or to just use the tk2dButton?
Title: Re: 2D Toolkit UI 1.0 beta 3
Post by: unikronsoftware on May 04, 2013, 10:33:10 pm
I suggest using this as the tk2dButton will be deprecated (possibly removed) in 2D Toolkit 2.0.
Title: Re: 2D Toolkit UI 1.0 beta 3
Post by: fsadeq on May 06, 2013, 04:54:54 am
Are there plans to allow the user to set parameters for a UIItem's SendMessageTarget?
Title: Re: 2D Toolkit UI 1.0 beta 3
Post by: unikronsoftware on May 06, 2013, 07:38:06 pm
By a parameter, would the tk2dUIItem caller be sufficient? I could actually change that right now - while it will break compatibility, it should be easy enough to fix.
Title: Re: 2D Toolkit UI 1.0 beta 3
Post by: fsadeq on May 07, 2013, 02:44:32 am
It should be. So long as you are able to pass parameters to the target it doesn't really matter.