private static void Render() { Terminal.Clear(); Terminal.Layer(1); if (Player != null) { Map.Draw(_mapLayer); MessageHandler.Draw(_messageLayer); StatPanel.Draw(_statLayer); if (ShowInfo) { InfoPanel.Draw(_leftLayer); } else { LookPanel.Draw(_leftLayer); } if (ShowEquip) { Player.Equipment.Draw(_rightLayer); } else { Player.Inventory.Draw(_rightLayer); } } StateHandler.Draw(); Animations.Draw(); Terminal.Refresh(); }
private void drawInfoPanel(Rhino.Display.DisplayPipeline pipeline, Rhino.Display.RhinoViewport viewport) { if (DrawUtil.DrawInfo) { if (_infoPanel == null) { _infoPanel = new InfoPanel(); var lines = Value.GetConnectionLines(); if (lines.Count == 1) { _infoPanel.Positions.Add((lines[0].From + lines[0].To) * 0.5); } else { _infoPanel.Positions.Add((lines[0].From + lines[0].To) * 0.5); _infoPanel.Positions.Add((lines[lines.Count - 1].From + lines[lines.Count - 1].To) * 0.5); _infoPanel.Positions.Add((lines[0].From + lines[lines.Count - 1].From) * 0.5); _infoPanel.Positions.Add((lines[0].To + lines[lines.Count - 1].To) * 0.5); } if (GroupId != 0) { _infoPanel.Content.Add("Grp: " + GroupId); } _infoPanel.Content.Add("Stf: " + Axial_stiffness + " / " + Rotational_stiffness + " / " + Transversal_stiffness); } _infoPanel.Draw(pipeline, viewport); } }
private void drawInfoPanel(Rhino.Display.DisplayPipeline pipeline, Rhino.Display.RhinoViewport viewport) { if (DrawUtil.DrawInfo) { if (_infoPanel == null) { _infoPanel = new InfoPanel(); _infoPanel.Positions.Add(Value.Location); _infoPanel.Content.Add("LC: " + LoadCase); if (!Forces.IsTiny()) { _infoPanel.Content.Add("Force: " + Forces.Length); } if (!Moments.IsTiny()) { _infoPanel.Content.Add("Moment: " + Moments.Length); } if (!Displacement.IsTiny()) { _infoPanel.Content.Add("Displacement: " + Displacement.Length); } if (!DisplacementRotational.IsTiny()) { _infoPanel.Content.Add("Rot.Displacement: " + DisplacementRotational.Length); } } _infoPanel.Draw(pipeline, viewport); } }
public override void Render() { Terminal.Clear(); StateHandler.Draw(); AnimationHandler.Draw(_mapLayer); bool inMission = StateHandler.Peek().Match( some: state => !(state is MenuState) && !(state is IntermissionFrameState), none: () => false); if (inMission) { InfoPanel.Draw(_infoLayer); RadarPanel.Draw(_radarLayer); ObjectivePanel.Draw(_objectiveLayer); MessagePanel.Draw(_messageLayer); foreach (KeyValuePair <ISchedulable, int> kvp in EventScheduler._schedule) { if (kvp.Key is DelayAttack da) { da.Draw(_mapLayer); } } } Terminal.Refresh(); }
private void drawInfoPanel(Rhino.Display.DisplayPipeline pipeline, Rhino.Display.RhinoViewport viewport) { if (DrawUtil.DrawInfo) { if (_infoPanel == null) { _infoPanel = new InfoPanel(); _infoPanel.Positions.Add(Value.Location); if (Id != 0) { _infoPanel.Content.Add("Id: " + Id); } } _infoPanel.Draw(pipeline, viewport); } }
public void Draw(GameTime gametime) { _game.GraphicsDevice.BlendState = BlendState.Opaque; _game.GraphicsDevice.DepthStencilState = DepthStencilState.Default; _game.GraphicsDevice.SamplerStates[0] = SamplerState.LinearWrap; _tunnel.Draw(_game.GraphicsDevice, world, _camera.View, _camera.Projection, farClip); _elemManager.DrawParticles(gametime); _game.GraphicsDevice.BlendState = BlendState.Opaque; _game.GraphicsDevice.DepthStencilState = DepthStencilState.Default; _game.GraphicsDevice.SamplerStates[0] = SamplerState.LinearWrap; _spriteBatch.Begin(); _infoPanel.Draw(gametime, _spriteBatch); DrawTools(_spriteBatch); _spriteBatch.End(); }
private void drawInfoPanel(Rhino.Display.DisplayPipeline pipeline, Rhino.Display.RhinoViewport viewport) { if (DrawUtil.DrawInfo) { if (_infoPanel == null) { _infoPanel = new InfoPanel(); var amp = AreaMassProperties.Compute(Value); _infoPanel.Positions.Add(Value.ClosestPoint(amp.Centroid)); if (Id != 0) { _infoPanel.Content.Add("Id: " + Id); } if (GroupId != 0) { _infoPanel.Content.Add("Grp: " + GroupId); } } _infoPanel.Draw(pipeline, viewport); } }
private void drawInfoPanel(Rhino.Display.DisplayPipeline pipeline, Rhino.Display.RhinoViewport viewport) { if (DrawUtil.DrawInfo) { if (_infoPanel == null) { _infoPanel = new InfoPanel(); _infoPanel.Positions.Add(Value.PointAtNormalizedLength(0.5)); _infoPanel.Content.Add("LC: " + LoadCase); if (!Forces.IsTiny()) { _infoPanel.Content.Add("Force: " + Forces.Length); } if (!Moments.IsTiny()) { _infoPanel.Content.Add("Moment: " + Moments.Length); } } _infoPanel.Draw(pipeline, viewport); } }
private void drawInfoPanel(Rhino.Display.DisplayPipeline pipeline, Rhino.Display.RhinoViewport viewport) { if (DrawUtil.DrawInfo) { if (_infoPanel == null) { _infoPanel = new InfoPanel(); var amp = AreaMassProperties.Compute(Value); _infoPanel.Positions.Add(Value.ClosestPoint(amp.Centroid)); _infoPanel.Content.Add("LC: " + LoadCase); if (!Forces.IsTiny()) { _infoPanel.Content.Add("Force: " + Forces.Length); } if (!Moments.IsTiny()) { _infoPanel.Content.Add("Moment: " + Moments.Length); } } _infoPanel.Draw(pipeline, viewport); } }
private void drawInfoPanel(Rhino.Display.DisplayPipeline pipeline, Rhino.Display.RhinoViewport viewport) { if (DrawUtil.DrawInfo) { if (_infoPanel == null) { _infoPanel = new InfoPanel(); if (Value.IsACurve) { _infoPanel.Positions.Add(Value.CurveA.PointAtNormalizedLength(0.5)); } else { _infoPanel.Positions.Add(Value.PointA.Location); } if (GroupId != 0) { _infoPanel.Content.Add("Grp: " + GroupId); } _infoPanel.Content.Add("Stf: " + Axial_stiffness + " / " + Rotational_stiffness + " / " + Transversal_stiffness); } _infoPanel.Draw(pipeline, viewport); } }
private void drawInfoPanel(Rhino.Display.DisplayPipeline pipeline, Rhino.Display.RhinoViewport viewport) { if (DrawUtil.DrawInfo) { if (_infoPanel == null) { _infoPanel = new InfoPanel(); _infoPanel.Positions.Add(Value.PointAtNormalizedLength(0.5)); if (Id != 0) { _infoPanel.Content.Add("Id: " + Id); } if (GroupId != 0) { _infoPanel.Content.Add("Grp: " + GroupId); } if (SectionIdStart != 0) { _infoPanel.Content.Add("Sec: " + SectionIdStart + (SectionIdEnd == 0 || SectionIdStart == SectionIdEnd ? "" : "." + SectionIdEnd)); } } _infoPanel.Draw(pipeline, viewport); } }
private void drawElements() { SdlHardware.ClearScreen(); complex.GetCurrentRoom().Draw(); info.Draw(); foreach (Dog d in complex.GetCurrentRoom().GetDogs()) { d.DrawOnHiddenScreen(); } foreach (Enemy e in complex.GetCurrentRoom().GetEnemies()) { e.DrawOnHiddenScreen(); } //dog.DrawOnHiddenScreen(); player.DrawOnHiddenScreen(); if (weapon.IsVisible()) { weapon.DrawOnHiddenScreen(); } complex.GetCurrentRoom().DrawItems(); //for (int i = 0; i < numEnemies; i++) // enemies[i].DrawOnHiddenScreen(); if (paused) { SdlHardware.WriteHiddenText("Paused. R to Return, Q to Quit.", 50, 300, 0xFF, 0xCC, 0xFF, font); } SdlHardware.ShowHiddenScreen(); }
public void Draw(GameTime gameTime) { m_gameWorldXna.Draw(gameTime); m_infoPanel.Draw(gameTime); }
public void Draw(SpriteBatch spriteBatch) { MouseState mouseState = Mouse.GetState(); string currentXP = _player.GetExperiencePoints().ToString(); string maximumXP = _player.GetMaxExperiencePoints().ToString(); int screenMouseX = mouseState.X; int screenMouseY = mouseState.Y; Vector2 mouseVectorScreen = new Vector2(screenMouseX, screenMouseY); Vector2 mouseVectorWorld = JustCombat.WorldCamera.ScreenToWorld(mouseVectorScreen); int worldMouseX = (int)(mouseVectorWorld.X); int worldMouseY = (int)(mouseVectorWorld.Y); string target = JustCombat.TargetingSystem.ToString(); // TODO: Need to keep this entire class and elements fixed to screen coords... //OrthographicCamera camera = JustCombat.WorldCamera; spriteBatch.Draw(_topBarBackpanel, new Vector2(0.0f, 0.0f), Color.White); spriteBatch.Draw(_actionBarPanel, new Vector2(((Constants.SCREEN_WIDTH / 2) - (_actionBarPanel.Width / 2)), (Constants.SCREEN_HEIGHT - _actionBarPanel.Height)), Color.White); int _counter = 324; for (int i = 0; i < actionKeys.Length; i++) { string text = actionKeys[i]; spriteBatch.DrawString(_fontCandara10, text, new Vector2(_counter, 729), Color.White); _counter = _counter + 52; } if (_player.GetLevel() < Constants.MAXIMUM_PLAYER_LEVEL) { spriteBatch.Draw(_xpBarFrame, new Vector2(282, 703), Color.White); _experienceBar.Draw(spriteBatch); spriteBatch.DrawString(_fontCandara10, "XP " + currentXP + " / " + maximumXP, new Vector2(560, 705), Color.White); } _playerInfoCard.Draw(spriteBatch); if (_target != null) { _targetInfoCard.Draw(spriteBatch); } if (InventoryPanel.IsDisplayed()) { InventoryPanel.Draw(spriteBatch); } if (CharacterPanel.IsDisplayed()) { CharacterPanel.Draw(spriteBatch); } if (_cursorInfoPanel.IsDisplayed()) { _cursorInfoPanel.Draw(spriteBatch); } if (_debug) { spriteBatch.DrawString(_fontConsolas13, DateTime.Now.ToString(), new Vector2(500.0f, 10.0f), Color.White); spriteBatch.DrawString(_fontConsolas13, "X: " + _player.GetX() + ", Y: " + _player.GetY(), new Vector2(500.0f, 30.0f), Color.White); //spriteBatch.DrawString(_fontConsolas13, "empty3: ", new Vector2(500.0f, 50.0f), Color.White); spriteBatch.DrawString(_fontConsolas13, target, new Vector2(500.0f, 70.0f), Color.White); //spriteBatch.DrawString(_font, "CD: " + CoolDownTimer.ToString(), new Vector2(550.0f, 50.0f), Color.White); spriteBatch.DrawString(_fontConsolas13, "Visible Actors: " + _actorList.Count.ToString(), new Vector2(730.0f, 10.0f), Color.White); //spriteBatch.DrawString(_fontConsolas13, "empty2: ", new Vector2(730.0f, 30.0f), Color.White); //spriteBatch.DrawString(_fontConsolas13, "empty3: ", new Vector2(730.0f, 50.0f), Color.White); //spriteBatch.DrawString(_fontConsolas13, "empty4: ", new Vector2(730.0f, 70.0f), Color.White); //spriteBatch.DrawString(_font, "Health " + _player.GetHitPoints().ToString() + " / " + _player.GetMaxHitPoints().ToString(), new Vector2(744.0f, 6.0f), Color.White); spriteBatch.DrawString(_fontConsolas13, " Player State: " + _player.GetState().ToString(), new Vector2(950.0f, 10.0f), Color.White); spriteBatch.DrawString(_fontConsolas13, "HealthBar State: " + _player.GetHealthBarState().ToString(), new Vector2(950.0f, 30.0f), Color.White); spriteBatch.DrawString(_fontConsolas13, " Heading: " + _player.GetDirection().GetHeading().ToString(), new Vector2(950.0f, 50.0f), Color.White); spriteBatch.DrawString(_fontConsolas13, " Taking Damage: " + _player._takingDamage.ToString(), new Vector2(950.0f, 70.0f), Color.White); spriteBatch.DrawString(_fontConsolas13, "Screen Mouse: (" + screenMouseX + "," + screenMouseY + ")", new Vector2(screenMouseX + 50, screenMouseY + 50), Color.White); spriteBatch.DrawString(_fontConsolas13, " World Mouse: (" + worldMouseX + "," + worldMouseY + ")", new Vector2(screenMouseX + 50, screenMouseY + 70), Color.White); ScrollTransformBounds.Draw(spriteBatch); ViewContainerBounds.Draw(spriteBatch); } spriteBatch.Draw(Cursor, _cursorPosition, Color.White); }
//====================================== // // OnGUI() - DRAW THE USER INTERFACE // // This function is the top level // draw routine for rendering the UI; // it's called twice: once to do the // layout, and once to draw the UI // //====================================== void OnGUI() { CalculateOverlayRect(); if (infoPanelVisible == false || Time.time - infoPanelTransStart < infoPanelTransTime * 0.5f) { // DRAW SOMETHING - info panel is either not showing, or in first half of fade-in switch (guiState) { //----------------------- // Overlay States // // entering, viewing and // leaving the main GUI //----------------------- case "guiStateEnteringOverlay": case "guiStateOverlay": case "guiStateLeavingOverlay": overlayPanel.Draw(guiOpacity); break; //----------------------- // Gameplay States // // entering, viewing and // leaving the 3D world //----------------------- case "guiStateEnteringGameplay1": // no GUI during initial camera zoom break; case "guiStateEnteringGameplay2": // fade-in of movement controls gameplayDisplay.Draw(guiOpacity, 0f, 0f); break; case "guiStateEnteringGameplay3": // fade-in of position indicators gameplayDisplay.Draw(1f, guiOpacity, 0f); break; case "guiStateEnteringGameplay4": // brief pause gameplayDisplay.Draw(1f, 1f, 0f); break; case "guiStateEnteringGameplay5": // fade-in of status displays gameplayDisplay.Draw(1f, 1f, guiOpacity); break; case "guiStateGameplay": // ongoing game-play state gameplayDisplay.Draw(1f, 1f, 1f); break; case "guiStateLeavingGameplay": // fade-out of game-play controls gameplayDisplay.Draw(guiOpacity, guiOpacity, guiOpacity); break; //------------------------------ // Feeding States // // entering, viewing and // leaving the feeding display //------------------------------ case "guiStateFeeding1": // fade-out of game-play controls gameplayDisplay.Draw(guiOpacity, guiOpacity, guiOpacity); break; case "guiStateFeeding2": // no GUI display during attack on deer break; case "guiStateFeeding3": // fade-in of feeding display main panel feedingDisplay.Draw(guiOpacity, guiOpacity, 0f, 0f); break; case "guiStateFeeding4": // brief pause feedingDisplay.Draw(1f, 1f, 0f, 0f); break; case "guiStateFeeding5": // fade-in of feeding display 'ok' button feedingDisplay.Draw(1f, 1f, guiOpacity, 0f); break; case "guiStateFeeding6": // ongoing view of feeding display feedingDisplay.Draw(1f, 1f, 1f, 0f); break; case "guiStateFeeding7": // fade-out of feeding display feedingDisplay.Draw(guiOpacity, guiOpacity, guiOpacity, 0f); break; case "guiStateFeeding8": // fade-in of movement controls gameplayDisplay.Draw(guiOpacity, 0f, 0f); break; case "guiStateFeeding9": // fade-in of position indicators gameplayDisplay.Draw(1f, guiOpacity, 0f); break; case "guiStateFeeding10": // brief pause gameplayDisplay.Draw(1f, 1f, 0f); break; case "guiStateFeeding11": // fade-in of status indicators gameplayDisplay.Draw(1f, 1f, guiOpacity); break; //------------------------------ // Puma Wins // // if during feeding // puma health reaches 100% //------------------------------ case "guiStatePumaWins1": // fade-out of feeding display main content // fade-in of puma wins display feedingDisplay.Draw(1f, 1f - guiOpacity, 0f, guiOpacity); break; case "guiStatePumaWins2": // brief pause feedingDisplay.Draw(1f, 0f, 0f, 1f); break; case "guiStatePumaWins3": // fade-in of puma wins 'ok' button feedingDisplay.Draw(1f, 0f, guiOpacity, 1f); break; case "guiStatePumaWins4": // ongoing view of puma wins display feedingDisplay.Draw(1f, 0f, 1f, 1f); break; case "guiStateLeavingPumaWins": // fade-out of puma wins display feedingDisplay.Draw(guiOpacity, 0f, guiOpacity, guiOpacity); break; } } //------------------------------ // Draw Info Panel //------------------------------ float elapsedTime = Time.time - infoPanelTransStart; float percentVisible = 0f; if (infoPanelVisible == true && elapsedTime < infoPanelTransTime) { // fading in percentVisible = elapsedTime / infoPanelTransTime; infoPanel.Draw(percentVisible); } else if (infoPanelVisible == true) { // fully visible infoPanel.Draw(1f); } else if (elapsedTime < infoPanelTransTime) { // fading out percentVisible = 1f - elapsedTime / infoPanelTransTime; infoPanel.Draw(percentVisible); } //------------------------------ // Frame Rate Display //------------------------------ if (displayFrameRate == true && levelManager != null) { GUI.color = Color.white; int msec = levelManager.frameAverageDuration; GUI.Box(new Rect(Screen.width * 0.24f - 80f, 0, 160, 24), "Avg Frame time: " + msec.ToString()); GUI.Box(new Rect(Screen.width * 0.50f - 80f, 0, 160, 24), "Screen Res: " + Screen.width.ToString() + "x" + Screen.height.ToString()); int averageFrameRate = (levelManager.frameAverageDuration == 0) ? 0 : (int)(1000 / levelManager.frameAverageDuration); GUI.Box(new Rect(Screen.width * 0.76f - 80f, 0, 160, 24), "Avg Frame rate: " + averageFrameRate.ToString()); GUI.Box(new Rect(Screen.width * 0.24f - 80f, Screen.height - 24, 160, 24), "displayVar1: " + levelManager.displayVar1.ToString()); GUI.Box(new Rect(Screen.width * 0.50f - 80f, Screen.height - 24, 160, 24), "displayVar2: " + levelManager.displayVar2.ToString()); GUI.Box(new Rect(Screen.width * 0.76f - 80f, Screen.height - 24, 160, 24), "displayVar3: " + levelManager.displayVar3.ToString()); } }