Author Topic: Hit area of popup lists and webplayer text input  (Read 4222 times)

MentalFish

  • Guest
Hit area of popup lists and webplayer text input
« on: November 15, 2012, 08:06:44 PM »
I am having some issues with input fields not working in the webplayer after upgrading to Unity4. They work inside Unity and standalone players. This was not an issue in 3.5.6.

Apart from that I am having some issues with drop down (popup lists) behaving strangely. The hit area is too small, the width of the dropdown area is too wide and the highlighter seems to have some unwanted padding:
http://dl.dropbox.com/u/1258056/Unity/NGUI_Drop-down_list.mov

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Hit area of popup lists and webplayer text input
« Reply #1 on: November 15, 2012, 10:22:42 PM »
Input never worked in Flash. I am not sure if that was ever fixed?

As for the padding size, check the sliced sprite you're using. My guess is that you need to eliminate the padding on it (select the atlas, select the sprite, remove padding), and possibly make the border smaller.

MentalFish

  • Guest
Re: Hit area of popup lists and webplayer text input
« Reply #2 on: November 16, 2012, 05:35:01 AM »
It's in the Unity Web Player, not Flash.

Using a sprite with no border or padding didn't do much to the clickable area size, the extra widening of the drop down or padding beneath each entry:

MentalFish

  • Guest
Re: Hit area of popup lists and webplayer text input
« Reply #3 on: November 16, 2012, 06:42:16 AM »
Feel free to see the web player input bug live here: http://dl.dropbox.com/u/1258056/Unity/NGUI_Built_with_Unity_4.html

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Hit area of popup lists and webplayer text input
« Reply #4 on: November 16, 2012, 05:21:57 PM »
The web player works fine for me, I'm able to type things just fine. Maybe something is wrong with your browser?

What about the padding setting on your UIPopupList?

MentalFish

  • Guest
Re: Hit area of popup lists and webplayer text input
« Reply #5 on: November 26, 2012, 10:15:36 PM »
I can't get input working in any browser, Chrome, Firefox, Opera and Safari. Could you tell me what Unity Plugin version and Engine version you get when going here: http://unity3d.com/webplayer/

This is all kinds of weird brokenness I am getting:
http://dl.dropbox.com/u/1258056/Unity/Unity_Web_Player_version_issues.png

The absurd width and padding issue happened due to the "reference font" I am using got set to the HD/Retina font in code. So now the cause for the problem is gone.
« Last Edit: November 26, 2012, 10:40:25 PM by MentalFish »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Hit area of popup lists and webplayer text input
« Reply #6 on: November 27, 2012, 12:28:23 PM »
There is a bug in Unity 4.0 that affects all web players on Mac OSX. It got fixed recently and will be in 4.0.1.

Builds created using Unity 3.5.6 work correctly.

MentalFish

  • Guest
Re: Hit area of popup lists and webplayer text input
« Reply #7 on: November 29, 2012, 07:37:27 AM »
Ok, thanks. I'll just wait out the web player issue until Unity Tech. have fixed it.

Another question though. As you can see, whenever I switch to the HD atlas and font, I get the misbehaving sizing again. This is regardless of where it runs, editor, web player or on retina type iOS device.



Do you have any suggestion as to why this is happening?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Hit area of popup lists and webplayer text input
« Reply #8 on: November 29, 2012, 07:43:59 AM »
All I can suggest is look at around line 480 of UIPopupList. That's where it creates the highlight. Background is created above that, on line 468. The dimensions for the size are done around line 485. Does it get the correct sprite? Does it use the proper atlas? The atlas referenced by the UIPopupList must be the reference atlas. If it references the HD atlas, then you have a problem.