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 - ENAY

Pages: 1 ... 5 6 [7] 8 9 ... 17
Sorry to bring up my old thread. But I am now interested in trying to get this feature to work.

I have a scrollable panel, using the usual UIPanel and UIDraggable Panel. If I hold the button down for about a second I want to be able to drag the Card out of the Window.

Except when I do click on a object the Panel still continues to drag, not only that, I can't drag it out of the UIPanel, it just vanishes off the edge of the dimensions that I set for the UIPanel.

Anyone else having any luck with doing something like this?

NGUI 3 Support / Re: Correct image size from Atlas?
« on: July 09, 2012, 03:36:38 AM »
Bizarrely it was the UISprites that were being weird, the Sliced UISprites were ok. Luckily, the MakePixelPerfect() trick worked. Many thanks for that :)

Now I can take out all my resizing kludge code.

NGUI 3 Support / Re: Correct image size from Atlas?
« on: July 09, 2012, 03:30:22 AM »
Yes, for some odd reason in some cases my sprites aren't being automatically, sometimes they are. But now that I think about it, they are sliced sprites when in reality they shouldn't be. This is probably what the problem could be. Thanks a lot for the tip.

NGUI 3 Support / Re: UISlider with more than 11 steps?
« on: July 08, 2012, 09:57:44 PM »
How do you modify it though? Do you mean in code?

This is indeed something I came across. The slider only seems to allow a maximum step of 0.1 if you try setting it in the editor.

NGUI 3 Support / Correct image size from Atlas?
« on: July 06, 2012, 01:23:30 AM »
Is there any way I can get the true image size when I add a sprite to an atlas. This has been bugging me for a while.

Ok, let's say I have a 256x256 of a guy's face. I have several faces.

Naturally the background is transparent. When I add these images to the atlas, none transparent lines of image will be omitted. eg, a 256x256 image may become something like 140x256.

Unfortunately then when I try to use the image that has been pre set in the atlas, the aspect ratio is the wrong shape :(
It will either be squished or in some cases be too big.

Any way to simply get around this?

The problem with that is, it was difficult to know when you would be dragging an object and swiping the screen since they both occupy the same space. In the end we have just decided to get rid of the swiping to the next screen and have a button instead, it also makes it easier to navigate. We had arrows flashing at the edges of the screen to show that you could swipe but instead people just clicking the arrows. So in the end we just changed them to buttons.

Who would have thought menu design could become so complicated to get feeling right. :)

NGUI 3 Support / Best way of emulating iPad/iPhone style scroll page?
« on: July 03, 2012, 11:09:45 PM »
On the iPad for example on the main menu, swiping back and forth switches between pages. Pressing for about 2 seconds on an icon allows you to drag around the icons on the page instead of scrolling of the page. I am trying to do something similiar with my menu.

Right now I have my Drag and Drop panel all working, I have two pages and you can drag to the next page, the problem I have is that the box collider for the screen swipe is below all the icons so it isn't possible to swipe the screen when pressing any of the icons.

Putting the box collider above everything else means that I can swipe the screen properly but then it is not possible to click on any of the buttons since the collider already catches everything. Is there any way in NGUI to emulate that press and hold feature or would it be better to try and write something myself?

NGUI 3 Support / Re: UIDrag problem
« on: July 01, 2012, 11:26:00 PM »
That was going to be my next question. How do I check if an object is being dragged directly?
There doesn't seem to be anything in UIDragObject to check whether it is on the move.


if (obj].GetComponentInChildren<UIDragObject>().isSelected == true)

If I check for


They are both always true.


Ok, in the end I have simply decided to just use onDrag, detect for button presses and releases and then do the collision code separately.

NGUI 3 Support / UIDrag problem
« on: July 01, 2012, 11:10:16 PM »
Simple question really, and struggling to figure out how to do it, but.

I want to drag a card onto a slot.

I have two objects, one I am moving around with UIDrag, All I want to do is drag it so it connects the other object and stay there. Now when I start dragging my object, I can't seem to figure out how to detect that it is hovering over the other one.

Looking in All it finds is the current object that I am clicking on.
And combined with my other issue in another thread. When I am dragging my thumb on the screen, I don't seem to have a way to detect whether a button (or anything) is under my thumb.

I am feeling really stupid not being able to do something which I think should be quite straight forward.

NGUI 3 Support / Re: Button -> Slide -> Release Button
« on: June 30, 2012, 05:13:43 AM »
Ok, still stuck with this.

[edit] Ok I seem to have fixed it now. Nothing more to see here. :)

NGUI 3 Support / Re: Button -> Slide -> Release Button
« on: June 29, 2012, 08:39:09 PM »
"How can you detect a finger hovering over the screen?"

Well that was my original question, but detection whilst a thumb has been pressed.

I will take a look at OnDrag instead.

NGUI 3 Support / Re: Button -> Slide -> Release Button
« on: June 29, 2012, 07:36:02 AM »
Actually no I was wrong.

Before the fix, I had to release the button to register the hoveredObject, after the fix it registered without having to release the button.

But it does not work on the iPhone or iPad at all.

Seems hoveredObject simply returns nothing on handheld devices. Not quite sure why that would be. Still investigating.


Looked all through the UICamera.cs code and couldn't see anything. Maybe this feature really is mouse only? (like the name suggests) As it works on iOs and Windows with a mouse.

I did mention in my first post that I was dragging my thumb so I am guessing that this feature is supposed to be working on hand held devices as well. Odd one that.

NGUI 3 Support / Re: Button -> Slide -> Release Button
« on: June 29, 2012, 07:17:05 AM »
I was just about to post and say it doesn't work in iPhone and iPad. So I guess it was a bug that crept through that you thought you'd updated?

Well, I changed the NGUI source code and now it seems to be working. A problem solved before I even asked the question :)

NGUI 3 Support / Re: Button -> Slide -> Release Button
« on: June 28, 2012, 11:44:54 PM »
Thanks ArenMook. That worked great.

Unfortunately once I held down the big button, it wouldn't update. However as soon as I released the button, it would check what was under the cursor, so I did my check then and everything turned out ok.

Not sure what will happen if I have multiple buttons held down, but we'll see later when I test it out.

Yep, you need a SlicedSprite. But you also need to set up your image in your atlas to support slices sprites.

Check out the Fantasy Atlas and look at the images in there, you will notice that they have padding at each corner, this is what allows them to restrict certainly pixels only.

Pages: 1 ... 5 6 [7] 8 9 ... 17