public override void InternalRender(RenderContext context) { base.InternalRender(context); if (_filler == null) { return; } var v = _value; if (v < Minimum) { v = Minimum; } if (v > Maximum) { v = Maximum; } var delta = Maximum - Minimum; if (delta.IsZero()) { return; } var filledPart = (v - Minimum) / delta; if (filledPart.EpsilonEquals(0.0f)) { return; } var bounds = ActualBounds; if (Orientation == Orientation.Horizontal) { _filler.Draw(context.Batch, new Rectangle(bounds.X, bounds.Y, (int)(filledPart * bounds.Width), bounds.Height), Color.White); } else { _filler.Draw(context.Batch, new Rectangle(bounds.X, bounds.Y, bounds.Width, (int)(filledPart * bounds.Height)), Color.White); } }
private void DrawIfNotNull(IRenderable skyPart, WSceneView view) { if (skyPart == null) { return; } skyPart.Draw(view); }
public void Render(Camera camera, IRenderable renderable) { var viewport = camera.Viewport; Gl.Viewport(viewport.X, viewport.Y, viewport.Width, viewport.Height); if (camera.IsVisible(renderable)) { renderable.Draw(camera); } }
public override void Update(GameTime gameTime) { if (Keyboard.GetState().IsKeyDown(Keys.Escape)) { Exit(); } AllScenes[ActiveScene].update(gameTime); render.Draw(AllScenes[ActiveScene], sprt); base.Update(gameTime); }
private void Render() { if (Device == null) // If the device is empty don't bother rendering { return; } Device.Clear(ClearFlags.Target | ClearFlags.ZBuffer, System.Drawing.Color.Blue, 1.0f, 0); // Clear the window to blue Device.BeginScene(); // Move Camera cam.move(); SetupMatrices(); // Draw Model model.Draw(Device); // UI //Panel.Render(Device); Device.EndScene(); Device.Present(); }
public void Draw(SpriteBatch spriteBatch) { Sprite.Draw(spriteBatch, MapCoordinates * GameDriver.CellSize); }
/// <summary> /// Draws texture region taking into account the context transformations /// </summary> /// <param name="renderable"></param> /// <param name="rectangle"></param> /// <param name="color"></param> public void Draw(IRenderable renderable, Point location, Color?color = null) { var c = color != null ? color.Value : Color.White; renderable.Draw(Batch, new Rectangle(location.X, location.Y, renderable.Size.X, renderable.Size.Y), c * Opacity); }
/// <summary> /// Draws texture region taking into account the context transformations /// </summary> /// <param name="renderable"></param> /// <param name="rectangle"></param> /// <param name="color"></param> public void Draw(IRenderable renderable, Rectangle rectangle, Color?color = null) { var c = color != null ? color.Value : Color.White; renderable.Draw(Batch, rectangle, c * Opacity); }
public void Draw(IRenderable renderable, GameTime gt) { renderable.Draw(gt); }