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.

Topics - ENAY

Pages: 1 [2] 3 4
NGUI 3 Support / Best way of swapping a texture / atlas?
« on: August 16, 2012, 01:59:27 AM »
I have a menu that will be simply a slideshow, using full screen images.

Up till now I have been creating my objects and everything by creating an atlas and then using them ingame.

But what I want to do is to be able to load a fullscreen image, free it and then load the next page.
Not sure how to do this yet in NGUI. Is it easily possible and if so, is it slow? Maybe I should load all my pages at once and then delete them after I have finished.

Am looking at UITexture at the moment.

If anybody has any tips. I would be most grateful :)

NGUI 3 Support / NGUI Performance questions
« on: August 10, 2012, 11:19:10 PM »
Ok Arenmook (and everyone else who is reading) :)

Been using NGUI for a fair while now, I have some questions about NGUI/Unity that I have been mulling over for a while, just wondering if anyone else has had any experiences like me.

(1) Whether or not it is me I don't know, but I find draggable panels to be pretty slow on iPhone4. Everything else, iPad2, iPhone3, iPhone4s seems to be ok. But just having one draggable panel, and especially 2 on the iPhone4. If that is all I have in my scene, there is a significant performance hit. Just wondering if it something I am doing wrong. But from my experience it is slow. Maybe an issue with shaders? I heard the fillrate of the iPhone4 is particular poor.

(2) Each Menu you create starts off with the Object name, then a Camera, Panel, Anchor etc, and from inside there you can create your own menu system. My question is about cameras.
If I say had a title_Screen menu system all contained within one object, that uses one camera. Is there going to be a performance hit if I have say a separate asset for ingame_menu and then chatwindow_menu?

Having 3 or 4 cameras is surely going to be a performance hit? Then again I don't really know too well how Unity works, if I have multiple cameras, surely each is just going to be called separately and is not really much different to adding an extra draw call, especially if each camera is rendering a separate layer.

Or am I wrong? I just don't know.

(3) UIDraggablePanel

The DraggablePanel works by having all the items in the draggable panel present and as you drab the panel they pop in and out of view. By my thinking, if I have 10 or 1000, if only 10 are shown in the window at any one time then surely there is no performance by having 1000? Problem is, deleting objects and creating them on the fly is surely going to bad for garbage collection. My question is basically, if I create 100 objects as my max and even if I am only using about 10 or so at a time on screen, is there a performance hit for having so many in the panel. This is of course in relation to UIDraggablePanel seemingly being quite slow on the iPhone4.

Thanks for reading :)

NGUI 3 Support / Double fingered pinch, stretch and zoom?
« on: August 09, 2012, 03:49:12 AM »
Not sure if this has been asked before, but does NGUI have a pinch function? There are lots of clicks, double clicks, swipes etc but I am almost certain that there is no pinch function in NGUI.

Just thought I would check though. :)

NGUI 3 Support / NGUI built in Keyboard?
« on: August 05, 2012, 10:22:12 PM »
Before I go out and make a 50 button menu to resemble a keyboard, just wanted to make sure that there isn't already an NGUI keyboard library?

NGUI 3 Support / UICamera.selectedObject one frame behind
« on: July 13, 2012, 02:54:13 AM »
Ok, I am using UICamera.selectedObject. After a button click I Debug.Log to see what is in the message and annoyingly it is always the previous message. So if I click on Button6 and then Button2, it will return Button6 instead of Button2.
Maybe I have my update in the wrong place. I am checking for button presses using onPress, does that mean I can't get the selectedObject until I release the button? (I want to have the result as soon as I press the button)

Any ideas?

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?

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 / 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 / Button -> Slide -> Release Button
« on: June 27, 2012, 11:47:32 PM »
Is there anyway to detect a button release without having actually pressed the button?

For example, I have my big button and one I press it four more buttons pop out, one on each side. It then looks like a joypad shape. Pressing this button again folds the 4 buttons away.

Now at the moment these 4 buttons require a release of the big button and then another click. What I would like to happen is like a popup selector window.

What I have done now is create it so when the big button is held the 4 buttons appear and fold away when you release the press. Is there anyway of making it so I drag my thumb to left right etc and then register a button press on the other 4 buttons?

Thanks :)

NGUI 3 Support / UIDraggablePanel - Multiple Lines?
« on: June 27, 2012, 03:14:27 AM »
When clicking on the Reposition Now Button, the list is repopulated into a single line. Is there anyway to have this list repositioned into 2 or 3 lines instead of just 1?

I had the idea of creating multiple Panels that could be scrolled with just 1. However that puts lots of complications in, such as having to populate 3 lists instead of 1, not to mention having to have 3 sets of duplicated panel data.

Has anyone else any experience of multiple line Draggable Panels?

NGUI 3 Support / Drag and Drop tutorial
« on: June 26, 2012, 03:45:09 AM »
I am guessing this is already a no, but I don't suppose there is a very simple tutorial on how to use UIDragObject?

I have dissected the Orc equipping and items on a cube examples of drag and drop but they seem a bit advanced for me to look at. I can understand that on the Orc one that once you click on an object it moves from the 3D gui to the 2d gui one. But when I try to take things out, such as deleting the Orc, all of a sudden nothing seems to appear anymore. And the prepared inventory stuff just adds to the confusion.

I'm more interested in the simple functionality, such as just working out how to do something really basic like how to how to drag an item from one box to the other would be really handy.

NGUI 3 Support / UIPanel with scroll buttons
« on: June 21, 2012, 12:54:09 AM »
Ok, I have a UIPanel but instead of scrolling it with click and drag, I have a left and right button either side.
I click a button and then I move the scroller in code. Simple eh?

Unfortunately I can't get a click to register with the right button because (as I have found out) that the collider is mixed with the hidden elements in the UIPanel.

In other words all the other elements are obscuring the button collision so clicking there does nothing. If I move the button up above the scroller it works, just doesn't work when in the same axis as the scroller.
Any tips on how to get around this?

NGUI 3 Support / OnPress and Drag at the same time?
« on: June 19, 2012, 01:16:03 AM »
Ok, so my UIPanel is draggable, it has button in it. However once you press a button and keep it held down the menu is no longer draggable. I don't suppose it is possible to be able to have the drag feature working at the same time?

NGUI 3 Support / Updating before displaying?
« on: June 17, 2012, 09:36:34 PM »
I have a problem now where when I first create my menu. There is about a 0.25 delay before it correctly adjusts to its proper size.

I am using

GameNGUI.GetComponent<UIRoot>().automatic = false
GameNGUI.GetComponent<UIRoot>().manualHeight = Screen.currentResolution.height;

but there is a noticable delay before the menu gets resized properly. Is there anyway to easily stop the menu from appearing on screen until it has been resized?

Something just caught me out. Ok, so I was going through my objects using GetComponentsInChildren<UIFilledSprite> and I decided to add 2 UISprites in the intention that I could simply get at them quickly with



Until I found out that no matter which I search for, both types of sprites are in the same list. Is this normal behaviour?
I am thinking that this is a feature.

Pages: 1 [2] 3 4