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

Pages: [1]
1
NGUI 3 Support / Re: UISprite Viewport distance to pixel width
« on: October 22, 2014, 06:47:06 AM »
D'oh - thanks, seem like Screen space is all i wanted. Thank you! This solution is working (connecting two Points with a single line-sprite, attatch this to a sprite with pivot set do "down"):

  1.  
  2.                 //Rotate towards Target;
  3.                 Quaternion newRotation = Quaternion.LookRotation(mTrans.position - target.position, Vector3.forward);
  4.                 newRotation.x = 0.0f;
  5.                 newRotation.y = 0.0f;
  6.                 mTrans.rotation = newRotation;
  7.  
  8.                 //Set Length
  9.                 float dist = Vector3.Distance(nguicam.WorldToScreenPoint(mTrans.position),nguicam.WorldToScreenPoint(target.position));
  10.  
  11.                 sprite.SetDimensions(width,(int)dist);

2
NGUI 3 Support / Re: UISprite Viewport distance to pixel width
« on: October 22, 2014, 05:54:23 AM »
Thanks for your answer, but i think this is not the problem - i could also do this with two empty gameObjects, and the distance is not really right. So you think that the code postet above should work like it is?

3
NGUI 3 Support / Re: UISprite Viewport distance to pixel width
« on: October 22, 2014, 04:52:03 AM »
I'm trying to do basically the same thing right now, and although i kind of understood what to do, i can't get it right - could you perhaps share a little piece of code? I am having a transform (sprite) and want to know the distance in "Ngui-Pixels" to another transform(sprite), so that i can build a line between these two.

I am using
  1.                
  2. float dist = Vector3.Distance(root.transform.InverseTransformPoint(transform.position),root.transform.InverseTransformPoint(target.position));
  3.  

, which is sort of right but off (same as boofcpw first post). Any Help would be very appreciated!

4
NGUI 3 Support / Re: Unity4 Beta Flash compile Error with Ngui
« on: September 11, 2012, 04:29:50 AM »
Thanks for your quick reply, found a solution that works for me: I changed the "pd" int in UIButtonPlayAnimation Script to a static value (1) - we don't need no button animations, so this works good for me. Performance is still a bit of a problem, but that's nothing new :)

5
NGUI 3 Support / Unity4 Beta Flash compile Error with Ngui
« on: September 11, 2012, 04:09:44 AM »
Hi,

i've got a problem: we are using Ngui for our Project and we are Developing for Flash Platform. With Unity 3.5 everything worked fine with Ngui, with Unity4 Beta i get the following error:

Error building Player: Exception: Compiling SWF Failed:
Loading configuration file C:\Program Files (x86)\Unity4.0\Editor\Data\PlaybackEngines\flashsupport\BuildTools\flex\frameworks\flex-config.xml

C:\Program Files (x86)\Unity4.0\Editor\Data\PlaybackEngines\flashsupport\BuildTools\UserBuild_AS3\FlashPlayerFeatures.as(30): col: 1 Warning: return value for function 'supportsLZMADecompression' has no type declaration.

      {
^

C:\Users\Public\Documents\Unity Projects\FlashExportBetaProject\Temp\StagingArea\Data\ConvertedDotNetCode\global\UIButtonPlayAnimation.as(109): col: 72 Error: Access of possibly undefined property value through a reference with static type int.

var $num: int = (-this.UIButtonPlayAnimation$playDirection$.value).value;
                                                                               ^

This error occurs whenever i just have imported the Ngui package, even in a new Project with nothing in it than a cube, a camera and the importet Ngui package...

Stupidly i did upgrade to the 4.0 Beta and did not make a backup of my project.. any ideas?

Greetings, Simon

Pages: [1]