コード例 #1
0
 /// <summary>
 /// Starts the Virtual Anatomy Lab
 /// </summary>
 public void Run()
 {
     using (Graphics.Graphics game = new Graphics.Graphics())
     {
         game.Run();
     }
 }
コード例 #2
0
 protected override void OnUpdate(Graphics.UpdateEventArgs e)
 {
     base.OnUpdate(e);
     Position = Common.Math.ToVector2(Game.Instance.Scene.Camera.Project(WorldPosition, Scene.Viewport));
     accTime += e.Dtime;
     Position -= Vector2.UnitY * accTime * ScrollSpeed;
     Timeout -= e.Dtime;
     if (Timeout <= 0)
         Remove();
 }
コード例 #3
0
 protected override void OnUpdate(Graphics.UpdateEventArgs e)
 {
     base.OnUpdate(e);
 }
コード例 #4
0
 protected override void OnUpdate(Graphics.UpdateEventArgs e)
 {
     base.OnUpdate(e);
     acc += e.Dtime;
     if (acc >= 0.03f && base.Text.Length != fullText.Length)
     {
         base.Text = fullText.Substring(0, t++);
         acc -= 0.03f;
     }
 }
コード例 #5
0
 protected override void OnUpdate(Graphics.UpdateEventArgs e)
 {
     base.OnUpdate(e);
     acc += e.Dtime * 40f;
     Position = new Vector2(0, -Size.Y + acc);
 }
コード例 #6
0
 protected override void OnUpdate(Graphics.UpdateEventArgs e)
 {
     base.OnUpdate(e);
     float a = alphaInterpolator.Update(e.Dtime);
     foreach(Graphics.Content.Graphic g in AllGraphics)
         g.Alpha = a;
 }
コード例 #7
0
 protected override void OnUpdate(Graphics.UpdateEventArgs e)
 {
     base.OnUpdate(e);
     if (IsRemoved) return;
     alpha.Update(e.Dtime);
     Invalidate();
 }
コード例 #8
0
 protected override void OnUpdate(Graphics.UpdateEventArgs e)
 {
     base.OnUpdate(e);
     if (IsRemoved) return;
     acc += e.Dtime;
     if (acc >= Duration)
         Remove();
 }
コード例 #9
0
 void Scene_EntityAdded(Graphics.Entity obj)
 {
     var cp = obj as Map.Checkpoint;
     if (cp != null)
     {
         Button b = new Button
         {
             Text = obj.Name,
             Position = new Vector2(0, y),
             Size = new Vector2(200, 20),
         };
         b.Click += new EventHandler((o, e) =>
         {
             Game.Instance.Map.MainCharacter.Position = obj.Translation;
             Game.Instance.Map.MainCharacter.AddRageLevelProgress(cp.RagePerc);
             Game.Instance.Map.MainCharacter.HitPoints = (int)(Game.Instance.Map.MainCharacter.MaxHitPoints * cp.HitPointsPerc);
             Game.Instance.Map.MainCharacter.PistolAmmo = cp.Ammo;
         });
         AddChild(b);
         y += 22;
     }
 }
コード例 #10
0
        protected override void OnUpdate(Graphics.UpdateEventArgs e)
        {
            base.OnUpdate(e);
            acc += e.Dtime;

            if (descend)
            {
                descendAccTime += e.Dtime;

                if (descendAccTime > descendDuration)
                {
                    // Subtracting 0.035 from descendAccTime to account for a repeating rounding error in order for achievements to descend to where they should
                    Position -= new Vector2(0, (descendDuration - (descendAccTime - 0.035f)) * 130 / descendDuration);
                    descendAccTime = 0;
                    descend = false;
                }
                else
                    Position -= new Vector2(0, e.Dtime * 130 / descendDuration);
            }
            if (acc >= 8)
            {
                achievementRemoved -= new Action(AchievementUnlockedPopup_achievementRemoved);
                if (achievementRemoved != null)
                    achievementRemoved();
                displayedAchievements--;
                Remove();
            }
        }
コード例 #11
0
 public void PlayActionAnimation(Graphics.AnimationPlayParameters parms)
 {
     actionAnimation = parms;
     actionAnimationPlaying = false;
     InvalidateAnimation();
 }
コード例 #12
0
 protected override void OnUpdate(Graphics.UpdateEventArgs e)
 {
     base.OnUpdate(e);
     foreach (var v in profilers)
     {
         if (Program.Settings.DisplayProfilers == ProfilersDisplayMode.PercTotal)
         {
             v.Second.Value = ((int)(100 * v.First.PercTotal)) * 0.01f;
             v.Second.MaxValue = 1;
             v.Second.Text = v.First.Name + " " + (int)(100*v.First.PercTotal) + "%";
         }
         else if (Program.Settings.DisplayProfilers == ProfilersDisplayMode.PercParent)
         {
             v.Second.Value = ((int)(100 * v.First.PercParent)) * 0.01f;
             v.Second.MaxValue = 1;
             v.Second.Text = v.First.Name + " " + (int)(100 * v.First.PercParent) + "%";
         }
         else
         {
             v.Second.Value = ((int)(100 * v.First.TimePerFrame)) * 0.01f;
             v.Second.MaxValue = 40;
             v.Second.Text = v.First.Name + " " + v.First.TimePerFrame.ToString("0.##") + " ms";
         }
         String tooltip = "";
         tooltip += v.First.TimePerFrame.ToString("0.##") + " ms\n\n";
         if(v.First.Children.Count > 0)
             tooltip += "Unaccounted time: " +
                 ((int)(100 * v.First.TimeUnaccountedPerc)) + "% " +
                 v.First.TimeUnaccounted.ToString("0.##") + " ms " +
                 "\n";
         if (v.First.Parent != null)
         {
             tooltip +=
                 "Parent: " + (int)(100 * v.First.PercParent) + "%\n" +
                 "Total: " + (int)(100 * v.First.PercTotal) + "%\n" +
                 "CallsPerFrame: " + v.First.CallsPerFrame + "\n" +
                 "CallsPerParent: " + v.First.CallsPerParent;
         }
         Program.Instance.Tooltip.SetToolTip(v.Second, tooltip);
     }
 }
コード例 #13
0
        protected override void OnUpdate(Graphics.UpdateEventArgs e)
        {
            base.OnUpdate(e);

            if (fpsTextBox != null)
            {
                string fpsText = Scene.View.FPS + " fps";
                if (Program.Settings.MotionSettings.UseMultiThreadedPhysics &&
                    !Program.Settings.MotionSettings.UseDummyMotion &&
                    Game.Instance.Mechanics != null)
                {
                    physicsBusy = physicsBusy * 0.99f + ((Common.Motion.ThreadSimulationProxy)Game.Instance.Mechanics.MotionSimulation).ThreadedBusyPerc * 0.01f;
                    fpsText += "\nPhys.: " +
                        (int)(100 * physicsBusy) + "%";
                }
                if(Program.Settings.FixedFrameStep)
                    fpsText += "\nMain:" + (int)(100*Program.Instance.FixedFrameStepActivity) + "%";
                fpsTextBox.Text = fpsText;
                String fpsTooltip = "";
                if (cpuCounter != null)
                {
                    cpuUsage = cpuUsage * 0.99f + cpuCounter.NextValue() * 0.01f;
                    fpsTooltip += "CPU Usage: " + cpuUsage + "%\n";
                }
                if (Game.Instance.Map != null)
                {
                    fpsTooltip += "Character position: " + Game.Instance.Map.MainCharacter.Translation + "\n";
                    fpsTooltip += "Camera lookat: " +
                        ((global::Graphics.LookatCamera)Game.Instance.Scene.Camera).Lookat + "\n";
                }
                fpsTooltip += "Text mem free: " + Scene.View.Device9.AvailableTextureMemory + "\n";
                fpsTooltip += "Entites: " + Game.Instance.Scene.Count + "\n";
                fpsTooltip += "InterfaceEntities: " + Program.Instance.InterfaceScene.Count + "\n";
                fpsTooltip += "DirectXObjects: " + ObjectTable.Objects.Count;
                //if (Program.Settings.EnableSound)
                //{
                //    fpsTooltip += "\nSound: " + Program.Instance.SoundManager.GetPerformanceString();
                //}
                Program.Instance.Tooltip.SetToolTip(fpsTextBox, fpsTooltip);
                //fpsTextBox.Tooltip = "TrianglesPerFrame: (" + renderer.TrianglesPerFrame + " + "
                //    + Program.Instance.InterfaceRenderer.TrianglesPerFrame + ") = " +
                //    (renderer.TrianglesPerFrame + Program.Instance.InterfaceRenderer.TrianglesPerFrame);
            }
            profilersResults.Visible = Program.Settings.DisplayProfilers != ProfilersDisplayMode.None;
            if (Program.Settings.DisplayInputHierarchy)
            {
                if (inputHierarchyTextBox.IsRemoved)
                    AddChild(inputHierarchyTextBox);
                inputHierarchyTextBox.Text = Program.Instance.InputHandler.GetInputHierarchyDescription();
            }
            else
            {
                if(!inputHierarchyTextBox.IsRemoved)
                    inputHierarchyTextBox.Remove();
            }

            if (Program.Settings.DisplayActiveActions && Game.Instance.Mechanics != null)
            {
                if (activeActionsTextBox.IsRemoved)
                    AddChild(activeActionsTextBox);
                activeActionsTextBox.Text = Game.Instance.Mechanics.ActiveScriptsToString();
            }
            else
            {
                if (!activeActionsTextBox.IsRemoved)
                    activeActionsTextBox.Remove();
            }

            dpsMeter.Visible = Program.Settings.DisplayDPS && Game.Instance.Map != null;

            if (silverText != null)
            {
                silverText.SilverYield = Game.Instance.SilverYield;
                silverText.Visible = Program.Settings.SilverEnabled;
                if (Game.Instance.Map != null && Game.Instance.Map.Settings.MapType != Client.Game.Map.MapType.Normal)
                {
                    silverText.Remove();
                    silverText = null;
                }
            }
        }
コード例 #14
0
 protected override void OnUpdate(Graphics.UpdateEventArgs e)
 {
     base.OnUpdate(e);
     timeAcc += e.Dtime;
     if (timeAcc > 10)
     {
         dps = damageAcc / timeAcc;
         ragePerSec = rageAcc / timeAcc;
         timeAcc = 0;
         damageAcc = 0;
         Text = "DPS: " + dps + "\nRagePS: " + ragePerSec;
     }
 }
コード例 #15
0
 protected override void OnUpdate(Graphics.UpdateEventArgs e)
 {
     base.OnUpdate(e);
     textGraphic.Alpha = alphaInterpolator.Update(e.Dtime);
 }
コード例 #16
0
 protected override void OnUpdate(Graphics.UpdateEventArgs e)
 {
     base.OnUpdate(e);
     var s = yInterpolator.Update(e.Dtime);
     Position = new Vector2(0, s);
 }
コード例 #17
0
        protected override void OnUpdate(Graphics.UpdateEventArgs e)
        {
            base.OnUpdate(e);

            silverTextBox.Text = ((int)silverInterpolator.Update(e.Dtime)).ToString("00000");
        }