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

Pages: [1]
1
Hi,

I'm facing this issue and really can't figure out why it's happening.

I have a 576x576 matchboard top-left centered.

I want to position a texture of a bag to the bottom-left corner and make it walk to the bottom-right corner.

So I do:

  1.                 // Creates the bag
  2.                 bagObject = NGUITools.AddChild(matchBoard.gameObject, bagPrototype);
  3.                 bag = bagObject.GetComponent<Match3EndBag>();
  4.  
  5.                 // Obtains data from the current matchboard grid, such as its dimensions
  6.                 UIWidget _UIWidget = matchBoard.GetComponent<UIWidget>();
  7.                 float _gridSize = _UIWidget.height;
  8.  
  9.                 // In local space we position it on the bottom left
  10.                 bag.transform.localPosition = new Vector3(0, -_gridSize);
  11.  
  12.                 bag.Init(introOutroDuration, walkingDuration, new Vector3(_gridSize, -_gridSize));

Now, in game I'm expecting to work perfectly, instead the localSpace coordinates of the bag are (0,-576, 0) but the bag is far from reaching the bottom of the widget, like there was some kind of weird scaling going on. Even the walking animation to the right stops before it has reached the other corner.

The matchboard is inside a UIRoot with Scaling Style Constrained, and content Width and Height set to 720, both with the Fit option enabled.

What's going on? By what should I multiply _gridSize? I tried with UIRoot.GetPixelSizeAdjustment(gameObject) without success...

Thanks for your time

2
NGUI 3 Support / NGUI 3.7.6 Unity 4.6.3f1 --- iOS Screen Rotation bug?
« on: March 25, 2015, 01:25:32 PM »
Hi,

I'm developing a game using NGUI 3.7.6 on Unity 4.6.3f1 and I'm experiencing a weird bug.

My match3-like game supports auto rotation and checks the device rotation to force a rotation if changed.

Everything works fine on the Web, PC, Android ports of the game.

When I export to iOS weird things happen:
Some bars do not reposition (the pink bars are child of the anchored blue bars).

Most important of all, when the game goes in Landscape mode the tiles in the game react strangely like  the input is rotated 90° in space. For example if I try to drag a piece down, it slides to the right instead. It also doesn't pick the actual tile my finger is under.

My UIRoot is set to be Constrained, 720x720 Width and Height Fit.

Each of the tile is actually a UITexture with a collider which triggers ondrag events to determine the direction of the move

I have really NO idea of what's going on but it only happens on iOS. I believe it's something related to NGUI.

As reference I'm attaching the desired result (that I have on all platforms but iOS) and the result on iOS.

Could you please help me sort this issue?

Thank you!



3
NGUI 3 Support / Getting OnClick event called on UITexture
« on: February 12, 2015, 12:36:42 PM »
Hi,

I know it may be a little trivial, but I'm trying to get the OnClick Event called on a UITexture but doesn't seem to work.

I'm attaching a screenshot as reference.

Am I missing something?

the attached behaviour contains a method:

  1.         public void OnClick()
  2.         {
  3.                 Debug.Log("Click!");
  4.                 if (!PreMatchManager.Instance.levelChosen
  5.                     && PreMatchManager.Instance.CanChooseLevel(levelNumber))
  6.                 {
  7.                         PreMatchManager.Instance.ChooseLevel(levelNumber);
  8.                 }
  9.         }
that never gets called!

4
NGUI 3 Support / UISprite "looking at" a position on a plane
« on: December 04, 2014, 02:18:38 PM »
Hi,

I was wondering, what's the best way to make a UISprite rotate to look at a certain position on a plane? I'm using a 2D Root so probably only Z rotation is involved.

Is there a way to Lerp/Slerp such rotation?

Thanks in advance

5
NGUI 3 Support / Dragging a UISprite in an area (for a match3 game)
« on: November 20, 2014, 05:56:37 PM »
Hi,

I'm building up a match 3 game with NGUI.
I was wondering how to use the DragObject Behaviour to make a UISprite move within its surroundings, eventually dropping it in place or restoring its previous position.

Is it possible to do?

Thanks in advance for your time ;)

6
Hi,
I was trying to interface FingerGestures with NGUI.

Fingergestures (that I need to catch swipes and drags) works with Screen coordinates while NGUI (scaling Style constrained) seems to work another way. Are there any utility functions that allows me to go from screen to local/global NGUI units and vice versa?

Thanks for your time.

Pages: [1]