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

Pages: [1]
NGUI 3 Support / Re: object Z-orders on screen
« on: September 20, 2014, 06:36:11 PM »
there is only one camera and all objects are at the same layer

NGUI 3 Support / object Z-orders on screen
« on: September 20, 2014, 02:34:21 AM »
I am writing 2d game.
In my scene, at the bottom, i have NGUI panel depth 1 and have a few buttons.
On top of that i have Unity's game object with animator that plays animation. it is in NGUI's panel with depth 2.
On top of that, i have NGUI's panel depth 3 that sometimes serve as pop up. It shows a sprite with message.

The problem i am having is that the panel's depth doesn't seem to apply to the animator object. it is always shown on the top of other panels.

Is there a way to make Unity game object to follow the panel depth order?

NGUI 3 Support / Re: OnDrag trigger order
« on: July 23, 2014, 12:37:54 AM »
thanks. i am not entirely surely how i can do "need to make sure that all colliders are on widgets, not empty game objects"
Here is my set-up. I have Main Camera displaying normal Unity game objects like tanks and blocks.
This is the camera that i want to be moved within the fixed world when mouse is dragged.
Today, I attached a script to this camera object that handles OnPress() and it is eating all messages even the ones that should go to other objects because I have collider that fits the camera's view.

Then I have UI Root and NGUI camera that shows UI like home buttons and status and they do not move.

How would I do this? Thanks

NGUI 3 Support / built in screen scroll by mouse?
« on: July 22, 2014, 12:20:49 AM »
Does NGUI provide an out of the box way of implementing dragging screen around the 2d world?
I can define max x and y. I am doing it by creating my own 2d collider and handling things myself but i was wondering if there is a better way.


NGUI 3 Support / OnDrag trigger order
« on: July 22, 2014, 12:19:40 AM »
I have Main Camera that has BoxCollider 2d. I am using it to receive OnDrag() and move the screen when cursor is dragged around the screen.
It works reasonably well until i want to receive OnPress event on other objects in the screen.
Basically the camera's collider is eating all events.
How do i order objects so that if click on an object, it receives OnPressed while if clicked on no object, the camera receive the event?

NGUI 3 Support / drag camera around
« on: June 28, 2014, 04:51:31 PM »
I am creating a 2d game and the game screen is bigger than the main camera.
I attached BoxCollider2D to the camera and handle OnDrag in the script attached to the camera.
This works great at moving the screen by dragging on it but whenever i click on the screen it always go to the BoxCollider and the object underneath never gets event.

Is there another way to move the camera by dragging mouse?

NGUI 3 Support / popup list label color
« on: April 13, 2014, 11:12:57 AM »
I am using UIPopupList and added a value:
"[99ff00]Colored![-]" as option but the text is not colored like other UILabel
Hierarchy view shows that there is "Drop-Down list" object with one label so i am not sure why this isn't being colored.

NGUI 3 Support / Fire at button release
« on: April 12, 2014, 09:11:27 PM »
I have code that while a button is pressed, strength goes up and when it is released, it launches missile at the strength.
Sometimes, even while i am pressing the button, it thinks i released and launches missile.
I think sometimes Update() doesn't think the key is pressed?

Here is my code
  1. bool pressed;
  2.         void OnPress(bool pressed)
  3.         {
  4.                 this.pressed = pressed;
  5.         }
  7.         public const float PowerMultiplier = 15.0f;
  8.         bool previouslyPressed;
  9.         void Update()
  10.         {
  11.                 if(LaunchMode)
  12.                 {
  13.                         if(pressed)
  14.                         {
  15.                                 if(!previouslyPressed)
  16.                                 {
  17.                                         Messenger.Broadcast("PLAYERTANK_RESET_POWER");
  18.                                         previouslyPressed = true;
  19.                                 }
  20.                                 Messenger.Broadcast("PLAYERTANK_UPDATE_POWER");
  21.                         }
  22.                         else if(previouslyPressed)
  23.                         {
  24.                                 previouslyPressed = false;
  25.                                 LaunchMode = false;
  26.                                 Messenger.Broadcast("PLAYERTANK_LAUNCHED");
  27.                         }
  28.                 }
  29.                 else
  30.                 {
  31.                         //todo: shield mode
  32.                 }

NGUI 3 Support / blurry text
« on: March 23, 2014, 09:41:45 PM »
hi, I am using UILabel with 'shrink content' and it makes the text really blurry.
See attached. how do i set it so that it isn't blurry? Am i using wrong option?
how do i use UILabel that i can use on multiple devices?

I have 2 scroll views side by side.
I am using code
  1. if(lastSelectedItem.Left) // buy
  2.                 {
  3.                         lastSelectedItem.transform.parent = RightGridControl.transform;
  4.                         lastSelectedItem.GetComponent<UIDragScrollView>().scrollView = RightScrollViewControl.GetComponent<UIScrollView>();
  5.                 }
  6.                 else //sell
  7.                 {
  8.                         lastSelectedItem.transform.parent = LeftGridControl.transform;
  9.                         lastSelectedItem.GetComponent<UIDragScrollView>().scrollView = LeftScrollViewControl.GetComponent<UIScrollView>();
  10.                 }
  11.                 lastSelectedItem.transform.localScale = new Vector3 (1, 1, 1);
  14.                 leftGrid.Reposition ();
  15.                 rightGrid.Reposition ();
  17.                 LeftScrollViewControl.GetComponent<UIScrollView>().UpdatePosition();
  18.                 LeftScrollViewControl.GetComponent<UIPanel> ().Refresh ();
  19.                 RightScrollViewControl.GetComponent<UIScrollView>().UpdatePosition();
  20.                 RightScrollViewControl.GetComponent<UIPanel> ().Refresh ();

This is called when a button is clicked and it does move an item from one UIGrid in one scrollview to UIGrid in another scrollview and UIGrid calculates correctly but the item simply doesn't get displayed.
I am calling Refresh on the scrollview control. What am i doing wrong?
The attached picture is supposed to show 2 items, but the 2nd one isn't displaying

NGUI 3 Support / Re: 2 scrollview, only one scrollbar shows
« on: March 20, 2014, 02:46:17 AM »
thanks that was it!

NGUI 3 Support / Re: 2 scrollview, only one scrollbar shows
« on: March 20, 2014, 02:03:15 AM »
I double checked they are using different scroll bars.
It is odd that when i drag the space between items, the right scroll bar and scroll view are moving.
But when i drag item in the 2nd scroll view, it moves the first scrollview/bar.

NGUI 3 Support / 2 scrollview, only one scrollbar shows
« on: March 20, 2014, 01:37:30 AM »
I created one scrollview and one scrollbar first and tested that it i can scull and scrollbar appears fine.
I duplicated both view and bar on the same scene, updated the 2nd scrollview to use the 2nd scrollbar, but when i drag on an item in the 2nd scrollview and move mouse, the first scrollview and scrollbar moves. the 2nd scrollbar doesn't even appear.
What am i doing wrong?

NGUI 3 Support / game camera zoom
« on: March 10, 2014, 04:30:45 AM »
I've just purchased NGUI so i am rather new :)
Is it possible to zoom using mobile gestures like pinch in NGUI?

Pages: [1]