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

Pages: 1 [2]
16
NGUI 3 Support / Re: (!!!) Improving NGUI: Voice your opinion
« on: December 16, 2013, 02:42:13 PM »
Quote
- NEW: Enabling/disabling widgets no longer affects other panels.

Sweet! :D Thanks Mike

17
NGUI 3 Support / Re: Joy stick?:
« on: December 10, 2013, 11:28:45 PM »
You can try putting 4 buttons on screen which rotate the Camera transform OnPress.

That would be the simplest form of a camera rotation control I could think of.

18
NGUI 3 Support / Re: Bug with HP Bars
« on: December 10, 2013, 11:10:40 PM »
Thanks for your reply, it helped me solve the problem :)

I was originally parenting my Enemy HP Bars to the Anchor gameobject(refer to my hierarchy above), because I thought that was a logical place for them to be. But the Anchor wasn't a UIPanel.

I eventually tried attaching a UIPanel script to the Anchor, because I guessed that they were parenting themselves to the 'Players' UIPanel, and for some reason that was changing it's transform.

I guess the moral of the story is that you need to have UIPanel on your parent object.

19
NGUI 3 Support / Re: Animated Textures?
« on: December 10, 2013, 10:22:41 PM »
Darn, oh well :(

Thanks for replying!

20
NGUI 3 Support / Animated Textures?
« on: December 10, 2013, 10:11:32 PM »
Hey Michael!

I remember watching a Unity Keystone video (I think that's what they are called) where you demonstrated a progress bar with an animated scrolling texture.

I have not found any examples of implementation, and it is too early to develop nice-to-haves, so I thought I would ask if you had any examples handy.

21
NGUI 3 Support / Re: Bug with HP Bars
« on: December 10, 2013, 05:53:58 PM »
I tried toggling 'enable' on UISprite instead of toggling 'Active' on the HP Bar's gameobject, the snapping persists.

So it looks as if UISprite does something when it is enabled? Maybe trying to find the right GameObject to parent itself to?

22
NGUI 3 Support / Re: Bug with HP Bars
« on: December 10, 2013, 04:13:44 AM »
Hi ArenMook, thanks for your reply.

I don't have any logic that moves Player 1's HP Bar, its default position is set in a Prefab. When I hit a Rat for the first time, I call SetActive(true) on the HP Bar linked to that rat, and that seems to make Player 1's HP Bar (the big one) snap to the center.

Then in the next frame, Player 1's HP Bar snaps back, without me moving it. I hope this made things a bit clearer, thanks.

23
NGUI 3 Support / Re: UIButton OnHover when mouse is already clicked
« on: December 09, 2013, 10:26:07 PM »
:P haha, yeah. I just read UICamera a bit, try out these new events?

OnDragStart / OnDragOver / OnDragOut / OnDragEnd

I don't actually know what happens right now when you click-drag into a button. I'm assuming the button simply doesn't respond?

24
NGUI 3 Support / Re: UIButton OnHover when mouse is already clicked
« on: December 09, 2013, 09:50:49 PM »
I have not tested this but :

you could create a transparent gameobject with a rigidbody, and set it's X,Y coordinates to match your mouse's screen position every frame. When it collides with the button you want, manually handle that and SendMessage("OnHover", button) to the button

25
NGUI 3 Support / Bug with HP Bars
« on: December 09, 2013, 08:48:06 PM »
Since a few versions ago (I think 3.0.6f7) my HP Bars have started having some strange bugs.

Some context to the problem :

My player has a HP Bar anchored to the top-left of the screen. I also give every Enemy in the game a HP Bar(instantiated in code), and make the Bar invisible(via SetActive(false)) in Initialize. When an enemy takes damage for the first time (and so has 100%< HP), I make his HP Bar visible (by doing SetActive(true)).

As soon as I set an Enemy's HP Bar to Active, the player's HP Bar snaps to the center of the screen, as if gaining an offset from the top left. This lasts for 1 frame, and then it snaps back to normal. This happens every single time I set an enemy's HP Bar to Active




I have looked through my code, and there is code that moves the HP Bars of enemies, but no other UI elements have code that change their positions.

The NGUI hierarchy looks like this :

UIRoot (My code here for instantiating player HUD and enemy HP Bars)
-Camera
--Anchor
---Enemy HP Bars
---Players (UIPanel)
----Player 1 (My code here to manage HP Bars and other elements)
----- HP Bar


Please let me know if you require more details

26
NGUI 3 Support / Re: (!!!) Improving NGUI: Voice your opinion
« on: November 27, 2013, 08:40:36 AM »
NGUI doesn't really handle multiple controllers at the moment.

I'm working on a local-coop game for up to 3 players where the screen is divided into 3 columns, and each player has their own menu that needs to accept input from just 1 specific controller.

There are numerous ways to work around this, at the moment we've decided to wrap UICamera and override ProcessOthers() to differentiate input devices, but it would be great if future versions took this into account :)

Thanks for the great framework Michael, you're doing a great job!

Pages: 1 [2]