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

Pages: [1] 2
1
hmm yeah, thanks, that makes sense.

So the panel wouldn't be anchored, right? But then how can I make a clipping area that's variable according with the size of the screen?

I need this because the toolbar "stretches" to accommodate more buttons when the window gets wider.

2
NGUI 3 Support / Anchored Panel & UIGrid: What's the right way to use it?
« on: November 25, 2014, 01:22:57 AM »
I'm trying to create a horizontal grid of buttons in a toolbar in the top of the screen, using 3.7.6.

I created an anchored panel to clip and contain this grid. The structure is exactly the same as the one found in example 7, except the panel is anchored.

Both panel and grid were created at 0,0,0.

What's the canonical way to make the UIGrid be drawn inside the clipping area? It's not being drawn there because the anchor in the panel changes the clipping area position and not the transform position.

The best way to achieve this was to check "Constrain to Panel" in UIGrid, but that doesn't work if I change the window size.

Thanks

3
NGUI 3 Support / Re: UIInput WINRT
« on: October 09, 2014, 08:58:51 PM »
Removing UNITY_WINRT from the MOBILE define, did it for me, after all UNITY_METRO is not mobile :)

UNITY_WINRT == UNITY_METRO || UNITY_WP8

4
NGUI 3 Support / Re: UIInput WINRT
« on: October 09, 2014, 02:10:15 PM »
I'm experiencing the same problem.

Quote
Generally if something works on one version of OS but not on the other, it's a Unity bug

I just want to make sure I'm in the same page as you guys: it works on Windows Phone 8 and not on Windows 8.1 (for PC). They are not different versions of the same OS, they are differents OS.

@mmalek, did you manage to get it working?

5
Nevermind, this was an Unity bug that they fixed but there was a regression in 4.5RC1.
Input.mousePosition reports wrong coordinates.

6
Hi ArenMook

I'm porting a game to Windows Phone and it uses NGUI 2.6.4. I really tried to upgrade but the effort for this is huge - it's worse because we didn't do the game so I don't know the game code well.

I'm experiencing a bug that you fixed in a newer version: for some Windows Phone devices (I guess the high resolution ones, like Lumia 1520), the widget colliders seem to have an offset in relation to the widget itself. For exemple, I have a button in the center of the screen but I have to tap in the right corner to click it.

Can you please guide me on where I should change to fix this? I can compare this old version with the newest and redo the changes, but I don't know where to start.

Thank you.

7
NGUI 3 Support / Re: Missing classes after upgrading NGUI
« on: April 14, 2014, 05:10:58 PM »
Thank you.
After importing the upgrade tools I still get a UIDragPanelContents not found error. How should I proceed?

8
NGUI 3 Support / Missing classes after upgrading NGUI
« on: April 14, 2014, 01:14:21 AM »
To upgrade NGUI from 2.x to 3.x I deleted the folder and imported the new package.
Two classes that were used in the project I'm working on don't exist anymore: UIFilledSprite and UIDragPanelContents.
What classes should I use to replace those?

Thank you!

9
NGUI 3 Support / Re: Resizing a game during gameplay.
« on: February 04, 2014, 02:59:02 PM »
I'm using the old one.

10
NGUI 3 Support / Resizing a game during gameplay.
« on: February 03, 2014, 12:43:00 AM »
I'm working on porting a game that was originally made to work in some resolutions, but now I have to support resizing (hence changing aspect ratio) during gameplay.

GUI elements are anchored so everything looks good when you start the game at a specific resolution. Also, UIRoot is set to FixedSize.

For supporting resizing I made a generic script that changes the Manual Height of the UIRoot proportionally with the new aspect ratio. So for example, when the window is rescaled to a narrower aspect ratio, the gui elements would be scaled to a smaller size to fit the width (imagine a horizontal toolbar of buttons that need to fit the width).

The problem with this solution is that some elements have a delta in their Y position to be properly positioned beneath another element, and changing the Manual Height of the UIRoot won't change this delta, so I end up with elements in wrong position or under other elements.

Is there a way to "reload" these elements, so their position and size can be recalculated based on the new aspect ratio?


11
NGUI 3 Support / Re: Problems changing layer of objects.
« on: October 30, 2013, 05:53:10 AM »
In split screen mode, there is one camera for each of two players. Some GUI objects have to be displayed for one player, depending on whose turn is. Other GUI objects have to be displayed for both players all the time.

The problem is that split screen mode is an addition to an existing game, and this game has already many prefabs containing GUI objects for both cameras and GUI objects for one camera under the same Panel.

It will require a great amount of work to separate the prefabs and refactor the code to make them under different panels.

So is there an easier way to do this? What if I create a script that adds a new UIPanel in the "branch" that I need to have a different layer? This new UIPanel would have same attributes of its parent UIPanel but different layer.

12
NGUI 3 Support / Re: Problems changing layer of objects.
« on: October 29, 2013, 11:19:03 PM »
So I've seen that you move widgets to the panel's layer on LateUpdate and that UIPanel is after the default time on script execution order.
The weird thing is that I did the same thing with my script (changed layer on LateUpdate) and after yours in the script execution order and still wasn't able to see it in only one camera.
Anyways... still need your help to find out the best way to do this.

13
NGUI 3 Support / Re: Problems changing layer of objects.
« on: October 29, 2013, 10:02:48 PM »
Did some further investigation and found out that it doesn't matter the layer of the object, all that matter is the layer of the object that contains the UIPanel script. Is that right?

So is it possible somehow to have objects with different layers under the same UIPanel?

14
NGUI 3 Support / Problems changing layer of objects.
« on: October 29, 2013, 09:30:56 PM »
I'm working on a "split screen" mode of a game and I have some GUI elements that should appear in only one of the two cameras.

I have a quite regular NGUI hierarchy:
-UI Root
--MainCamera
---MainCameraClone
---SomePrefab
----Anchor1
----Anchor2

Except for MainCameraClone everything is like a generic NGUI tree. MainCameraClone is just a camera with the same attributes of MainCamera but with a different layer mask.
MainCamera can see layers "GUI" and "Player1" and MainCameraClone can see "GUI" and "Player2".
All objects have "GUI" as their layer, so their appear on both cameras.

I made a script to change the layer of the gameObject and all of its children, and attached it to Anchor2.
When I hit play I can see that the layer of Anchor2 and its children is different than GUI. Nevertheless the camera object appear on both camera.

It works when I add the script to SomePrefab instead of Anchor2, but I can't do that since Anchor1 must keep its original layer. And I don't want to separate the prefab in 2 because there are many prefabs.

So why do this happen? An object should be seen by the camera that can see its layer independent of the value of its parents layer, right?



15
NGUI 3 Support / OnPress being called multiple times
« on: October 14, 2013, 03:26:28 AM »
This one is driving me crazy...

I'm working on a port that uses NGUI 2.1.X. I have a monitor with touch support. I'm disabling mouse, touch, controller and keyboard on UICamera. Still, outside editor OnPress is being called once when using mouse and twice (2 with down == true and 2 with down == false). It correctly doesn't call when on editor.

I'm sure there aren't any UICameras with input enabled.

Is there any way to get OnPress called without mouse/touch enabled on UICamera?

Pages: [1] 2