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

Pages: [1]
1
NGUI 3 Support / Re: UIPanel 'snapping' to position when moved in code
« on: February 10, 2014, 07:10:52 AM »
Typical, fixed it within seconds of asking for help.

Problem was the objects were on a GUI layer. I made a new one called "InWorldGUI", and shifted them to that and it seems to work fine.

Is there some sort of default setting for layers called "GUI"?

2
NGUI 3 Support / UIPanel 'snapping' to position when moved in code
« on: February 10, 2014, 07:07:15 AM »
I have a "Marker" object. It's a UIPanel, with a child UISprite and UILabel, being drawn in world space. The panel object's position is moved manually in a circle around the player, to point at a target object.

Code itself works fine, but something in nGUI is forcing the panel to 'snap' to a grid, and I cant find where. NGUI->Options->Snapping is off.

What's causing this jerky, jump behaviour? It only happens in nGUI panels, not other types of in-world sprite.

Ta,

@danthat

3
NGUI 3 Support / Re: Tracking and Pointing Towards Off-Screen Enemies
« on: November 10, 2012, 02:59:40 PM »
Ah, ok. Thanks. And what about generating suitable widgets at runtime? Is there a sensible method behind that?

4
NGUI 3 Support / Tracking and Pointing Towards Off-Screen Enemies
« on: November 10, 2012, 08:46:50 AM »
I'd like to use nGUI to point the player towards any off-screen enemies. So if an enemy is 400 metres to the right of the player, you'd get a little enemy icon pointing in his general direction. Terrible mockup screenshot example:



I can't quite get my head around the best way to do it using nGUI. Should I be using HUDtext for this, or is it all possible with nGUI vanilla?

Problem is, I'm unsure how to generate widgets at runtime with nGUI. I can grab all Colliders in range of the player with Physics.OverlapSphere and test Renderer.IsVisible... but I then need a way of generating widgets and clamping the labels to screen extremities.

Ideally I guess all Enemy objects would just have a child widget that I send to my Panel if !Renderer.IsVisible, but that doesn't seem workable because I think widgets require a Panel parent? Is that right?

Any suggestions gratefully received. I thought this sort of thing would be widely discussed, but I've been Googling around the subject for a couple of hours and haven't found a decent solution.

Pages: [1]