Author Topic: NGUI Pickers - WebPlayer  (Read 8989 times)

Gregzo

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 64
    • View Profile
NGUI Pickers - WebPlayer
« on: July 03, 2013, 04:51:39 AM »
Hi to all,

I finally had enough free time to give my pickers project a bit of work.

-Horizontal and vertical
-Momentum
-Infinite
-Labels, sprites, compound objects
-Add / remove elements dynamically
-Receive selection callbacks as index or content ( label text, spritename )
-Recycles 5 objects for best performance ( no instantiate )

Here's a web player demo
WebPlayer

I plan to release it on the Asset Store soon, comments and suggestions are welcome!

Known issue : doesn't handle well very fast dragging. The workaround I can think of involves modifying UIDragPanelContents, which really isn't suitable for a publicly available asset. Any ideas to clamp drag values without changing NGUI classes ? [EDIT] : Issue solved, will post a new build soon. Pickers can now handle any speed.

Cheers,

Gregzo
« Last Edit: July 03, 2013, 12:18:08 PM by Gregzo »

sonicviz

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 58
    • View Profile
Re: NGUI Pickers - WebPlayer
« Reply #1 on: July 03, 2013, 05:27:47 AM »
Looking good.

Some feedback:
Middle mouse button would be useful to scroll vertical pickers, as it's a default behavior most users are familiar with and will possibly find frustrating if not there.
For horizontal pickers maybe add fast scroll arrows to the sides?

Of course these suggestions are  for desktop/mouse use, on a touch device swipe works fine for both as is.

Gregzo

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 64
    • View Profile
Re: NGUI Pickers - WebPlayer
« Reply #2 on: July 03, 2013, 06:59:29 AM »
Hi sonicviz,

Thanks for the feedback.

I have to figure out a way to deal with the scroll wheel - fire UICenterOnChild.Recenter at the right moment.

About fast scroll arrows : what behaviour exactly are you thinking of? Hold to scroll fast, or click to forward n elements?
NGUI already has good scroll bar support, maybe on desktop that would be more appropriate than pickers...

Cheers,

Gregzo

sonicviz

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 58
    • View Profile
Re: NGUI Pickers - WebPlayer
« Reply #3 on: July 03, 2013, 07:56:32 PM »
Hi sonicviz,

Thanks for the feedback.

I have to figure out a way to deal with the scroll wheel - fire UICenterOnChild.Recenter at the right moment.

About fast scroll arrows : what behaviour exactly are you thinking of? Hold to scroll fast, or click to forward n elements?
NGUI already has good scroll bar support, maybe on desktop that would be more appropriate than pickers...

Cheers,

Gregzo

Hold to scroll might work.


Gregzo

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 64
    • View Profile
Re: NGUI Pickers - WebPlayer
« Reply #4 on: July 04, 2013, 03:25:00 AM »
Scroll wheel support and scroll buttons added.

Any other suggestions ?

hrlarsen

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 3
  • Posts: 35
    • View Profile
Re: NGUI Pickers - WebPlayer
« Reply #5 on: July 04, 2013, 03:38:58 AM »
It looks pretty neat :)

A suggestion would be to have 2 types of pickers. The one you have in the web demo is repeatable which is awsome, but maybe also one which has a limit. As an example a date picker would have date and month repeatable and year as a fixed amount of choices (ex. 1900-2013).

Have you tested how smooth it is on mobile?

Gregzo

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 64
    • View Profile
Re: NGUI Pickers - WebPlayer
« Reply #6 on: July 04, 2013, 03:50:37 AM »
@hrlarsen

Hi and thanks for the input!

Will implement number pickers now - elements recycling logic is in a seperate class from content logic, so it'll be pretty easy to specify a min, a max, and a step ( all even numbers from 25 to 39247 for example ).

Will test on iOS today, and give news.

Gregzo

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 64
    • View Profile
Re: NGUI Pickers - WebPlayer
« Reply #7 on: July 04, 2013, 09:12:02 AM »
New build available :
GregzosPickerHeaven

New features :
-Date picker in 6 languages ( request yours! )
-Number picker
-Scroll wheel support
-Scroll buttons

Fixes :
-Better momentum feel
-Any drag speed is now handled

Suggestions still welcome, releasing soon!

Cheers,

Gregzo

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: NGUI Pickers - WebPlayer
« Reply #8 on: July 04, 2013, 07:14:48 PM »
That's looking really good. Excellent job. If it's priced nicely, I'll be sure to pick it up. ;)

Gregzo

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 64
    • View Profile
Re: NGUI Pickers - WebPlayer
« Reply #9 on: July 05, 2013, 01:15:40 AM »
@Nicki

Thanks for the compliment!

I now need to clean up and comment the code, organise prefabs, write a readme, and submit. Hopefully by early next week!

Would 10$ be too much? The only other asset I have in the asset store is 5$, and that ended up being a bit cheap considering the work it took and the amount of copies sold...

Cheers,

Gregzo

hrlarsen

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 3
  • Posts: 35
    • View Profile
Re: NGUI Pickers - WebPlayer
« Reply #10 on: July 05, 2013, 02:24:43 AM »
I would happily pay 10$ for it ;) and thanks for implementing the requested features

Gregzo

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 64
    • View Profile
Re: NGUI Pickers - WebPlayer
« Reply #11 on: July 05, 2013, 01:03:06 PM »
Just a little update - feel free to add requests as I'm nearing completion.

-Date picker now supports time as well, date and time prefab available. GetCurrentDateTime() to retrieve the selected date and time as a System.DateTime struct.

-Following ArenMook's suggestion, dropped compatibility with NGUI free. Upside : delegates are now used, resulting in better performance and flexibility.

-Delegate implementation means it is now easy to build compound pickers : picker element can now contain any number of sprites or labels. 3 sprites, 2 labels - 4 labels, 2 sprites - whatever you need is possible. Prefab included features 2 sprites and 1 label : item sprite, price label, and currency sprite. Think : orc armour boots sprite (item sprite), 4 (price label) gold coins (currency sprite).

-Tested performance on iPhone 4 ( not 4gs ) : 60 fps with the demo scene, lots of pickers in there!

-Code structure improvement : the PickerManagerBase class implements the Template Method pattern - meaning you can learn about design patterns, but also easily extend the class for custom behaviours. Design Patterns are definitely in!

Cheers,

Gregzo

Gregzo

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 64
    • View Profile
Re: NGUI Pickers - WebPlayer
« Reply #12 on: July 05, 2013, 05:49:35 PM »
Updated the WebPlayer : PickersForPickers WebPlayer

New :
Compound picker : as many labels or sprites per element as you need!
Full DateTime support!
Delegates!
Design patterns!

Picker Heaven...

Last chance for suggestions.

Cheers,

Gregzo

Gregzo

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 64
    • View Profile
Re: NGUI Pickers - WebPlayer
« Reply #13 on: July 10, 2013, 10:24:25 AM »
Submitted to the Asset Store, should be out ( hopefully ) next week.

Here's the Unity Forums support thread, tutorial videos links included :

http://forum.unity3d.com/threads/189766-Soon-NGUI-Infinite-Pickers-A-complete-picker-framework


Cheers,

Gregzo

Gregzo

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 64
    • View Profile
Re: NGUI Pickers - WebPlayer
« Reply #14 on: July 18, 2013, 04:09:06 PM »
Released!

Info,tutorials, support, feedback and asset store link here :
http://forum.unity3d.com/threads/189766-Released-NGUI-Infinite-Pickers-A-complete-picker-framework