Advertisement
Guest User

Untitled

a guest
Sep 22nd, 2014
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. class HudInfo : ZilchComponent
  2. {
  3. function Initialize(init : CogInitializer)
  4. {
  5. Zero.Connect(this.Space, Events.LogicUpdate, this.OnLogicUpdate);
  6. }
  7.  
  8. function OnLogicUpdate(event : UpdateEvent)
  9. {
  10. this.GuideArrow();
  11. }
  12.  
  13. function GuideArrow()
  14. { // http://pastebin.com/LA3MknPk
  15. // https://dl.dropboxusercontent.com/u/10336668/HudDirTest.zip
  16. var hudSpace = this.GameSession.FindSpaceByName("HudSpace");
  17. var guide = hudSpace.FindObjectByName("GuideArrows");
  18. var destination = guide.Transform.Translation;
  19. var screen = hudSpace.LevelSettings.CameraViewport.WorldToScreen(destination);
  20. destination = this.LevelSettings.CameraViewport.ScreenToWorldZPlane(screen, 0.0);
  21.  
  22. var winBoxRef = this.Space.FindObjectByName("WinBox");
  23. var unitCircle = DebugSphere();
  24. var vectorVisual = DebugLine();
  25.  
  26. unitCircle.Position(guide.Transform.Translation);
  27. unitCircle.Radius(1.0);
  28. unitCircle.Float4Color(Real4(1.0, 1.0, 1.0, 1.0));
  29. vectorVisual.HeadSize(0.25);
  30. vectorVisual.Start(Real3(-8.0, -8.0, 0.0));
  31. vectorVisual.End(winBoxRef.Transform.Translation);
  32.  
  33. }
  34. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement