Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class HudInfo : ZilchComponent
- {
- function Initialize(init : CogInitializer)
- {
- Zero.Connect(this.Space, Events.LogicUpdate, this.OnLogicUpdate);
- }
- function OnLogicUpdate(event : UpdateEvent)
- {
- this.GuideArrow();
- }
- function GuideArrow()
- { // http://pastebin.com/LA3MknPk
- // https://dl.dropboxusercontent.com/u/10336668/HudDirTest.zip
- var hudSpace = this.GameSession.FindSpaceByName("HudSpace");
- var guide = hudSpace.FindObjectByName("GuideArrows");
- var destination = guide.Transform.Translation;
- var screen = hudSpace.LevelSettings.CameraViewport.WorldToScreen(destination);
- destination = this.LevelSettings.CameraViewport.ScreenToWorldZPlane(screen, 0.0);
- var winBoxRef = this.Space.FindObjectByName("WinBox");
- var unitCircle = DebugSphere();
- var vectorVisual = DebugLine();
- unitCircle.Position(guide.Transform.Translation);
- unitCircle.Radius(1.0);
- unitCircle.Float4Color(Real4(1.0, 1.0, 1.0, 1.0));
- vectorVisual.HeadSize(0.25);
- vectorVisual.Start(Real3(-8.0, -8.0, 0.0));
- vectorVisual.End(winBoxRef.Transform.Translation);
- }
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement