Skip to content

Android and Universal Wizard

Ask for help here ;)

Android and Universal Wizard

Postby Visionaries 777 » 07 Apr 2011, 04:32

I'm still playing around Universe and start to look at the Universal Wizard blocks which are great! Because there is no proper LB to play with Android touchscreen it could be the way to experiment it for now. I was looking at all the function and I made a few working like "GetVersion":

Image

But there is no point about this LB because we can anyway already find it in "UnityEngine -> AndroidJNI -> AndroidJNI Do -> Get Version" . Anyway, what's about the touchscreen? For example let's try to get the fingerId, what should be the way?
I've tried this but I have no idea about what must be the input of the LB and how to select it:

Image
User avatar
Visionaries 777
 
Posts: 50
Joined: 29 Mar 2011, 07:15
Location: Hong Kong

Re: Android and Universal Wizard

Postby pax » 07 Apr 2011, 07:08

We forgot to add LB to work with Touch properties, but you can get Touch from Input:

Image

We will add Touch LBs in next build, now you can use Universal Get/Set for this task.
User avatar
pax
 
Posts: 65
Joined: 27 Jan 2011, 20:21

Re: Android and Universal Wizard

Postby Visionaries 777 » 07 Apr 2011, 09:03

Cool, now I can get the device orientation (UnityEngine -> Input -> Input Get -> deviceOrientation) and its acceleration (UnityEngine -> Input -> Input Get -> acceleration) just to name them.
But I'm still stuck with the GetTouch because this one requires an integer as input and I have no idea what should it be :?
User avatar
Visionaries 777
 
Posts: 50
Joined: 29 Mar 2011, 07:15
Location: Hong Kong

Re: Android and Universal Wizard

Postby Visionaries 777 » 07 Apr 2011, 09:36

Alright, still digging and I found the mousePosition (UnityEngine -> Input -> Input Get -> mousePosition) works on Android! Make sense because we can already drag a window (VIZIO -> GUI -> Window).
So it's great! I know Android devices support only two fingers at the time (by the way it's possible to know how many fingers are tracked with the LB touchCount) so how could we now get the two separate vector attached to each finger ID?
User avatar
Visionaries 777
 
Posts: 50
Joined: 29 Mar 2011, 07:15
Location: Hong Kong

Re: Android and Universal Wizard

Postby pax » 08 Apr 2011, 07:34

Unfortunately I have no Android device.
But i think, you need to turn on multitouch by Input Set >> multiTouchEnabled and when check Input Get >> touchCount to specify how may tuoches on the screen. Or you can get touches array by Input Get >> touches.

  1. Create Input Get >> touches
  2. Create Generic Array Iterator (Vizio >> Arrays)
  3. Drag Input Get >> touches output variable on array iterator to make it touch array iterator
  4. Use Universal Wizard Get Value to get touch values. See screenshot, this block are selected. (Use drag varible on this block too to make it typed to get values from touch)
  5. Turn values checkboxes in inspector to get necessary variables
Image
User avatar
pax
 
Posts: 65
Joined: 27 Jan 2011, 20:21

Re: Android and Universal Wizard

Postby Visionaries 777 » 08 Apr 2011, 10:11

Thanks Pax :)
User avatar
Visionaries 777
 
Posts: 50
Joined: 29 Mar 2011, 07:15
Location: Hong Kong

Re: Android and Universal Wizard

Postby Kamilla1 » 24 Nov 2015, 14:15

Excellent !! really nice posts! thanks
Kamilla1
 
Posts: 11
Joined: 24 Nov 2015, 13:11


Return to HELP!!!

Who is online

Registered users: No registered users