Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - JazzMasta

Pages: [1]
1
NGUI 3 Support / Touch / Click position on a Sprite in percent?
« on: September 25, 2014, 03:57:39 AM »

How do you get the width/height of a UISprite and touch/position?

I'm want something like this (psuedo code):

float percentX = touch.x / width;
float percentY = touch.y / height;


2
NGUI 3 Support / Adding transparent button/clickarea to sprites or textures
« on: September 24, 2014, 04:02:11 AM »

I have a big background image (UITexture) to which I wish to add some interactive areas which are to receive touch events.

I have tried to place an empty GameObject, then add a box collider and a NGUI->Attach->Button Script to the object. But when I implement an OnPress() method on the object, it never gets called.
Also, the debug output for the camera doesn't recognize the object when hovering the mouse over it.

Do I have to make a transparent-png Sprite to make "invicible" buttons/clickareas?

3
NGUI 3 Support / Scaling, anchors and different screen sizes
« on: September 23, 2014, 07:26:22 AM »

I want to place a big background texture and a bunch of sprites in a Panel and put that in a UIScrollView, then I want the Panel and its contents to scale so that it always fills upp the left and right sides of the device/screen. So there should be no cropping on the left/right sides, the scrolling content should just exactly fit the width of the device. Is this possible?

Also, when I place objects (sprites) with anchors relative to the background texture, I want to use percent instead of units,
is this possible or is there some other way to place objects to that the follow a scaling background?

thanks



Pages: [1]