예제 #1
0
 public override void Draw(GameTime gameTime)
 {
     ScreenManager.SpriteBatch.Begin(0, null, null, null, null, null, Camera.View);
     for (int i = 0; i < _softBodies.Count; ++i)
     {
         ScreenManager.SpriteBatch.Draw(_softBodyBox.Texture,
                                        ConvertUnits.ToDisplayUnits(_softBodies[i].Position), null,
                                        Color.White, _softBodies[i].Rotation, _softBodyBox.Origin, 1f,
                                        SpriteEffects.None, 0f);
     }
     for (int i = 0; i < _softBodies.Count; ++i)
     {
         ScreenManager.SpriteBatch.Draw(_softBodyCircle.Texture,
                                        ConvertUnits.ToDisplayUnits(_softBodies[i].Position), null,
                                        Color.White, _softBodies[i].Rotation, _softBodyCircle.Origin, 1f,
                                        SpriteEffects.None, 0f);
     }
     for (int i = 0; i < _bridgeBodies.Count; ++i)
     {
         ScreenManager.SpriteBatch.Draw(_bridgeBox.Texture,
                                        ConvertUnits.ToDisplayUnits(_bridgeBodies[i].Position), null,
                                        Color.White, _bridgeBodies[i].Rotation, _bridgeBox.Origin, 1f,
                                        SpriteEffects.None, 0f);
     }
     ScreenManager.SpriteBatch.End();
     _border.Draw();
     base.Draw(gameTime);
 }
예제 #2
0
        internal override void Draw(GameTime gameTime)
        {
            _batch.Begin(samplerState: SamplerState.PointClamp);

            _batch.DrawRectangle(Controller.ClientRectangle, Border.DefaultWhite);

            var(unit, startX, width, height) = Border.GetDefaultScreenValues();
            if (_showInfoText)
            {
                var offsetY = Controller.ClientRectangle.Height / 2 - Border.SCREEN_HEIGHT * unit / 2 + unit * 8;
                var offsetX = startX + unit * 4;
                Border.Draw(_batch, offsetX, offsetY, 16, 10, Border.SCALE, Border.DefaultWhite);

                _fontRenderer.DrawText(_batch, _infoText, new Vector2(offsetX + unit, offsetY + unit * 2), Color.Black, Border.SCALE);
            }
            else
            {
                _optionsBox.Draw(_batch, Border.DefaultWhite);

                var offsetY = Controller.ClientRectangle.Height / 2 - Border.SCREEN_HEIGHT * unit / 2 + unit * 12;
                Border.Draw(_batch, startX, offsetY, 15, 6, Border.SCALE, Border.DefaultWhite);
                var timeStr = DateHelper.GetDisplayDayOfWeek(DateTime.Now).ToUpper() + Environment.NewLine +
                              "   " + DateHelper.GetDisplayDaytime(World.DetermineDaytime()).PadRight(4).ToUpper() + DateTime.Now.ToString("h:mm").PadLeft(5);
                _fontRenderer.DrawText(_batch, timeStr, new Vector2(startX + unit, offsetY + unit * 2), Color.Black, Border.SCALE);
            }

            _batch.End();
        }
예제 #3
0
        public override void Render(UiContext context, RectangleF parentRectangle)
        {
            var rect = GetMyRectangle(context, parentRectangle);

            Background?.Draw(context, rect);
            float y  = rect.Y + rect.Height;
            float dt = (float)context.DeltaTime;

            lock (Chat.Messages)
            {
                for (int i = Chat.Messages.Count - 1; i >= 0 && (i >= Chat.Messages.Count - 16); i--)
                {
                    var msg = Chat.Messages[i];
                    if (msg.TimeAlive <= 0)
                    {
                        continue;
                    }
                    msg.TimeAlive -= dt;
                    var sz = context.RenderContext.Renderer2D.MeasureStringCached(ref msg.Cache, msg.Font, context.TextSize(msg.Size),
                                                                                  msg.Text);
                    float h = context.PixelsToPoints(sz.Y);
                    y -= h;
                    DrawText(context, ref msg.Cache, new RectangleF(rect.X, y, rect.Width, h), msg.Size, msg.Font,
                             msg.Color, InterfaceColor.Black, HorizontalAlignment.Left, VerticalAlignment.Default,
                             false, msg.Text);
                    y -= 2;
                }
            }
            Border?.Draw(context, rect);
        }
예제 #4
0
        /// <summary>
        /// Draw the highlighted cells.
        /// </summary>
        /// <param name="graphics"></param>
        /// <param name="drawingRange">The range of cells that must be redrawed. Consider that can contains also not selected cells.</param>
        protected virtual void DrawHighlight(DevAge.Drawing.GraphicsCache graphics, Range drawingRange)
        {
            if (Region.IsEmpty() ||
                Region.IntersectsWith(drawingRange) == false)
            {
                return;
            }

            System.Drawing.Brush brush = graphics.BrushsCache.GetBrush(BackColor);

            foreach (Range rng in Region.GetRanges())
            {
                System.Drawing.Rectangle rectToDraw = Grid.RangeToRectangle(rng);
                if (rectToDraw == System.Drawing.Rectangle.Empty)
                {
                    continue;
                }

                System.Drawing.RectangleF contentRect = Border.GetContentRectangle(rectToDraw);

                graphics.Graphics.FillRectangle(brush, contentRect);

                Border.Draw(graphics, rectToDraw);
            }
        }
예제 #5
0
        public override void Draw(Microsoft.Xna.Framework.GameTime gameTime)
        {
            ScreenManager.SpriteBatch.Begin(0, null, null, null, null, null, Camera.View);

            for (int i = 0; i < supers.Count; i++)
            {
                ScreenManager.SpriteBatch.Draw(superAgentTexture, new Rectangle(
                                                   (int)supers[i].X,
                                                   (int)supers[i].Y, 6, 6),
                                               null,
                                               Color.Red,
                                               0f,
                                               new Vector2(3, 3),
                                               SpriteEffects.None, 0);
            }

            for (int s = 0; s < populationSimulator.Population.Count; s++)
            {
                for (int i = 0; i < populationSimulator.Population[s].Count; i++)
                {
                    DrawIndividual(populationSimulator.Population[s][i], populationSimulator.Population[s][i].getDisplayColor(), individualTexture, populationSimulator.Population[s][i].EmitterType);
                }
            }

            Border.Draw(ScreenManager.SpriteBatch, Camera);

            ScreenManager.SpriteBatch.End();
            base.Draw(gameTime);
        }
예제 #6
0
 /// <summary>
 /// Draws the gauge.
 /// </summary>
 /// <param name="e">Draw event arguments.</param>
 public override void Draw(FRPaintEventArgs e)
 {
     base.Draw(e);
     scale.Draw(e);
     pointer.Draw(e);
     Border.Draw(e, new RectangleF(AbsLeft, AbsTop, Width, Height));
 }
예제 #7
0
        public override void Paint(Graphics g)
        {
            var area = Area;

            Border.Draw(g, area.Round());
            DrawText(g, TextRectangle);
        }
예제 #8
0
        private void DrawMain()
        {
            border.Draw();
            int cardHeight = 9;
            int cardWidth  = Renderer.GetCardWidth(cardHeight);

            //int cardWidth =
            Renderer.DrawCard(
                new Card(Suit.Clubs, Rank.Ace),
                width - sideMargin - cardWidth - 2,
                height - cardHeight - 1,
                cardHeight,
                cardWidth
                );
            Renderer.DrawCard(
                new Card(Suit.Clubs, Rank.Ace),
                width - sideMargin - cardWidth * 2 - 3,
                height - cardHeight - 1,
                cardHeight,
                cardWidth
                );


            Renderer.DrawTable(centerX, centerY, width / 2, height / 2);
            //Renderer.DrawCard(new Card(Suit.Clubs, Rank.Ace), width - 40, height - cardHeight - 1, cardHeight);
        }
예제 #9
0
        public override void Draw(GameTime gameTime)
        {
            ScreenManager.SpriteBatch.Begin(0, null, null, null, null, null, Camera.View);
            ScreenManager.SpriteBatch.Draw(background, new Rectangle(-ScreenManager.GraphicsDevice.Viewport.Width / 2, -ScreenManager.GraphicsDevice.Viewport.Height / 2, ScreenManager.GraphicsDevice.Viewport.Width, ScreenManager.GraphicsDevice.Viewport.Height), Color.Red);
            // otkomentiraj ovo za gledat kako izgleda model
            //            ScreenManager.SpriteBatch.Draw(_rectangleSprite.Texture, ConvertUnits.ToDisplayUnits(_rectangle.Position),
            //                               null,
            //                               Color.White, _rectangle.Rotation, _rectangleSprite.Origin, 1f,
            //                               SpriteEffects.None, 0f);

            characterSprite.Draw(ScreenManager.SpriteBatch, new Vector2(_rectangle.Position.X - characterSprite.Width / 2, _rectangle.Position.Y - characterSprite.Height / 2));

            ScreenManager.SpriteBatch.DrawString(ScreenManager.Content.Load <SpriteFont>("Font"), "width, height: " + _rectangle.Position.X + " " + _rectangle.Position.Y, new Vector2(0, 130), Color.Black);

            // otkomentiraj ovo za gledat kako izgleda path sisa
            //for (int i = 0; i < _bridgeBodiesL.Count; ++i)
            //{
            //    ScreenManager.SpriteBatch.Draw(_bridgeBox.Texture,
            //                                   ConvertUnits.ToDisplayUnits(_bridgeBodiesL[i].Position), null,
            //                                   Color.White, _bridgeBodiesL[i].Rotation, _bridgeBox.Origin, 1f,
            //                                   SpriteEffects.None, 0f);
            //}
            //for (int i = 0; i < _bridgeBodiesR.Count; ++i)
            //{
            //    ScreenManager.SpriteBatch.Draw(_bridgeBox.Texture,
            //                                   ConvertUnits.ToDisplayUnits(_bridgeBodiesR[i].Position), null,
            //                                   Color.White, _bridgeBodiesR[i].Rotation, _bridgeBox.Origin, 1f,
            //                                   SpriteEffects.None, 0f);
            //}

            ScreenManager.SpriteBatch.End();
            _border.Draw();

            base.Draw(gameTime);
        }
예제 #10
0
        public override void Draw(GameTime gameTime)
        {
            BatchEffect.View       = Camera.View;
            BatchEffect.Projection = Camera.Projection;
            SpriteBatch.Begin(SpriteSortMode.Deferred, null, null, null, RasterizerState.CullNone, BatchEffect);

            foreach (Body body in _softBodies)
            {
                SpriteBatch.Draw(_softBodyBox.Texture, body.Position, null, Color.White, body.Rotation, _softBodyBox.Origin, new Vector2(1f, 1f) * _softBodyBox.TexelSize, SpriteEffects.None, 0f);
            }

            foreach (Body body in _softBodies)
            {
                SpriteBatch.Draw(_softBodyCircle.Texture, body.Position, null, Color.White, body.Rotation, _softBodyCircle.Origin, new Vector2(1f, 1f) * _softBodyCircle.TexelSize, SpriteEffects.None, 0f);
            }

            foreach (Body body in _bridgeBodies)
            {
                SpriteBatch.Draw(_bridgeBox.Texture, body.Position, null, Color.White, body.Rotation, _bridgeBox.Origin, new Vector2(0.25f, 1f) * _bridgeBox.TexelSize, SpriteEffects.None, 0f);
            }

            SpriteBatch.End();

            _border.Draw(Camera.Projection, Camera.View);

            base.Draw(gameTime);
        }
예제 #11
0
        public override void Draw(GameTime gameTime)
        {
            ScreenManager.SpriteBatch.Begin(SpriteBlendMode.AlphaBlend);

            _agent.Draw(ScreenManager.SpriteBatch);
            _springRectangleRope1.Draw(ScreenManager.SpriteBatch);
            _springRectangleRope2.Draw(ScreenManager.SpriteBatch);
            _platform1.Draw(ScreenManager.SpriteBatch);
            _platform2.Draw(ScreenManager.SpriteBatch);
            _platform3.Draw(ScreenManager.SpriteBatch);
            _floor.Draw(ScreenManager.SpriteBatch);
            _angularSpringLever1.Draw(ScreenManager.SpriteBatch);
            _angularSpringLever2.Draw(ScreenManager.SpriteBatch);
            _angularSpringLever3.Draw(ScreenManager.SpriteBatch);
            _angularSpringLever4.Draw(ScreenManager.SpriteBatch);

            ScreenManager.SpriteBatch.Draw(_hangingTexture, _hangingGeom.Position, null, Color.White,
                                           _hangingGeom.Rotation,
                                           new Vector2(_hangingTexture.Width / 2f, _hangingTexture.Height / 2f), 1,
                                           SpriteEffects.None, 0);

            _border.Draw(ScreenManager.SpriteBatch);

            if (_mousePickSpring != null)
            {
                _lineBrush.Draw(ScreenManager.SpriteBatch,
                                _mousePickSpring.Body.GetWorldPosition(_mousePickSpring.BodyAttachPoint),
                                _mousePickSpring.WorldAttachPoint);
            }

            ScreenManager.SpriteBatch.End();

            base.Draw(gameTime);
        }
예제 #12
0
        public override void Draw(GameTime gameTime)
        {
            LineBatch.Begin(Camera.Projection, Camera.View);
            foreach (Fixture f in _obstacles.FixtureList)
            {
                LineBatch.DrawLine(_distanceBody[0].Position, _distanceBody[1].Position, ContentWrapper.Black);
                LineBatch.DrawLine(_distanceBody[2].Position, _distanceBody[3].Position, ContentWrapper.Black);
            }
            LineBatch.End();

            BatchEffect.View       = Camera.View;
            BatchEffect.Projection = Camera.Projection;
            SpriteBatch.Begin(SpriteSortMode.Deferred, null, null, null, RasterizerState.CullNone, BatchEffect);
            for (int i = 0; i < 3; i++)
            {
                SpriteBatch.Draw(_angleCube.Texture, _angleBody[i].Position, null, Color.White, _angleBody[i].Rotation, _angleCube.Origin, new Vector2(1.5f, 1.5f) * _angleCube.TexelSize, SpriteEffects.FlipVertically, 0f);
            }
            for (int i = 0; i < 4; i++)
            {
                SpriteBatch.Draw(_distanceCube.Texture, _distanceBody[i].Position, null, Color.White, _distanceBody[i].Rotation, _distanceCube.Origin, new Vector2(1.5f, 1.5f) * _distanceCube.TexelSize, SpriteEffects.FlipVertically, 0f);
            }
            SpriteBatch.End();

            LineBatch.Begin(Camera.Projection, Camera.View);
            foreach (Fixture f in _obstacles.FixtureList)
            {
                LineBatch.DrawLineShape(f.Shape, ContentWrapper.Black);
            }
            LineBatch.End();

            _border.Draw(Camera.Projection, Camera.View);

            base.Draw(gameTime);
        }
예제 #13
0
        /// <inheritdoc/>
        public override void Draw(FRPaintEventArgs e)
        {
            if (ColumnCount == 0 || RowCount == 0)
            {
                return;
            }

            lockColumnRowChange = true;
            Width  = Columns[Columns.Count - 1].Right;
            Height = Rows[Rows.Count - 1].Bottom;
            lockColumnRowChange = false;

            base.Draw(e);

            // draw table Right to Left if needed
            if (Config.RightToLeft)
            {
                DrawTableRtl(e);
                // !! ����������� ������ !!
                //Border.Draw(e, new RectangleF(FLeftRtl - Width + AbsLeft, AbsTop, Width, Height));
                Border.Draw(e, new RectangleF(AbsLeft, AbsTop, Width, Height));
            }
            else
            {
                DrawTable(e);
                Border.Draw(e, new RectangleF(AbsLeft, AbsTop, Width, Height));
            }
            DrawDesign(e);
        }
예제 #14
0
        public void Draw(SpriteBatch spriteBatch)
        {
            _border.Draw();

            var timeString = GetTimeString();

            spriteBatch.DrawString(
                _font,
                timeString,
                new Vector2(Game.ScreenWidth * 0.5f, Border.BorderSize),
                Color.White,
                0.0f,
                new Vector2(_font.MeasureString(timeString).X / 2, 0.0f).SnapToPixels(),
                1.0f,
                SpriteEffects.None,
                0);

            var startY = _border.Y + Border.BorderSize;

            foreach (var figure in _level.Figures)
            {
                var startX = GetStartXFromColor(figure.Id);

                Heads.Draw(spriteBatch, figure.Id, startX, startY, _font.LineSpacing, _font.LineSpacing);
                spriteBatch.DrawString(_font,
                                       figure.Wins.ToString(CultureInfo.InvariantCulture),
                                       new Vector2(startX + _font.LineSpacing + Border.BorderSize, startY),
                                       Color.White);
            }
        }
예제 #15
0
        public override void Draw(GameTime gameTime)
        {
            BatchEffect.View       = Camera.View;
            BatchEffect.Projection = Camera.Projection;
            SpriteBatch.Begin(SpriteSortMode.Deferred, null, null, null, RasterizerState.CullNone, BatchEffect);

            for (int i = 0; i < 5; ++i)
            {
                SpriteBatch.Draw(_rectangleSprite.Texture, _rectangle[i].Position, null,
                                 Color.White, _rectangle[i].Rotation, _rectangleSprite.Origin, new Vector2(1.5f, 1.5f) * _rectangleSprite.TexelSize, SpriteEffects.FlipVertically, 0f);
            }

            SpriteBatch.End();
            LineBatch.Begin(Camera.Projection, Camera.View);

            foreach (Fixture f in _ramps.FixtureList)
            {
                LineBatch.DrawLineShape(f.Shape, ContentWrapper.Teal);
            }

            LineBatch.End();

            _border.Draw(Camera.Projection, Camera.View);

            base.Draw(gameTime);
        }
예제 #16
0
        public override void Draw(GameTime gameTime)
        {
            ScreenManager.SpriteBatch.Begin(SpriteBlendMode.AlphaBlend);
            _border.Draw(ScreenManager.SpriteBatch);
            _agent.Draw(ScreenManager.SpriteBatch);

            _redCircles1.Draw(ScreenManager.SpriteBatch);
            _redCircles2.Draw(ScreenManager.SpriteBatch);
            _redCircles3.Draw(ScreenManager.SpriteBatch);

            _greenCircles1.Draw(ScreenManager.SpriteBatch);
            _greenCircles2.Draw(ScreenManager.SpriteBatch);
            _greenCircles3.Draw(ScreenManager.SpriteBatch);

            _blueCircles1.Draw(ScreenManager.SpriteBatch);
            _blueCircles2.Draw(ScreenManager.SpriteBatch);
            _blueCircles3.Draw(ScreenManager.SpriteBatch);

            _blackCircles1.Draw(ScreenManager.SpriteBatch);
            _blackCircles2.Draw(ScreenManager.SpriteBatch);
            _blackCircles3.Draw(ScreenManager.SpriteBatch);

            if (_mousePickSpring != null)
            {
                _lineBrush.Draw(ScreenManager.SpriteBatch,
                                _mousePickSpring.Body.GetWorldPosition(_mousePickSpring.BodyAttachPoint),
                                _mousePickSpring.WorldAttachPoint);
            }

            ScreenManager.SpriteBatch.End();

            base.Draw(gameTime);
        }
예제 #17
0
        public void Draw(SpriteBatch batch)
        {
            if (Visible)
            {
                var unitsHeight = 2 + _options.Length * 2;

                var width  = (int)(WIDTH * UNIT * SCALE);
                var height = (int)(unitsHeight * UNIT * SCALE);
                var unit   = (int)(UNIT * SCALE);
                var startX = Controller.ClientRectangle.Width - width;
                var startY = 0;

                Border.Draw(batch, startX, startY, WIDTH, unitsHeight, SCALE);

                var screenManager = GetComponent <ScreenManager>();
                var selectorChar  = screenManager.ActiveScreen == _parentScreen ? ">" : "^>>";

                var text = string.Join(Environment.NewLine,
                                       _options.Select((t, i) => (i == _index ? selectorChar : " ") + t.Replace("PLAYER", Controller.ActivePlayer.Name)));

                _fontRenderer.DrawText(batch, text, new Vector2(startX + unit, startY + unit * 2), Color.Black, SCALE);

                // draw explanations
                if (Controller.GameOptions.MenuExplanations)
                {
                    Border.DrawCenter(batch, startX, startY + height, WIDTH, 5, SCALE);

                    var descText = DESCRIPTION_TEXTS[_options[_index]];

                    _fontRenderer.DrawText(batch, descText, new Vector2(startX, startY + height + unit), Color.Black, SCALE);
                }
            }
        }
        public override void Draw(GameTime gameTime)
        {
            BatchEffect.View       = Camera.View;
            BatchEffect.Projection = Camera.Projection;
            SpriteBatch.Begin(SpriteSortMode.Deferred, null, null, null, RasterizerState.CullNone, BatchEffect);
            for (int i = 0; i < 3; i++)
            {
                if (_breakableCookie[i].State == BreakableBody.BreakableBodyState.Broken)
                {
                    for (int j = 0; j < _breakableCookie[i].Parts.Count; j++)
                    {
                        var part  = _breakableCookie[i].Parts[j];
                        var shape = (PolygonShape)part.Shape;
                        var aabb  = shape.Vertices.GetAABB();
                        var box   = new Vector2(aabb.Width, aabb.Height);
                        SpriteBatch.Draw(_breakableSprite[j].Texture, part.Body.Position, null, Color.White, part.Body.Rotation, _breakableSprite[j].Origin, box * _breakableSprite[j].TexelSize, SpriteEffects.FlipVertically, 0f);
                    }
                }
                else
                {
                    SpriteBatch.Draw(_completeSprite.Texture, _breakableCookie[i].MainBody.Position, null, Color.White, _breakableCookie[i].MainBody.Rotation, _completeSprite.Origin, new Vector2(10.66f) * _completeSprite.TexelSize, SpriteEffects.FlipVertically, 0f);
                }
            }
            SpriteBatch.End();

            _border.Draw(Camera.Projection, Camera.View);

            base.Draw(gameTime);
        }
예제 #19
0
        public override void Draw(GameTime gameTime)
        {
            Sprites.Begin(0, null, null, null, null, null, Camera.View);

            foreach (Body body in _softBodies)
            {
                Sprites.Draw(_softBodyBox.Image, ConvertUnits.ToDisplayUnits(body.Position), null, Color.White, body.Rotation, _softBodyBox.Origin, 1f, SpriteEffects.None, 0f);
            }

            foreach (Body body in _softBodies)
            {
                Sprites.Draw(_softBodyCircle.Image, ConvertUnits.ToDisplayUnits(body.Position), null, Color.White, body.Rotation, _softBodyCircle.Origin, 1f, SpriteEffects.None, 0f);
            }

            foreach (Body body in _bridgeBodies)
            {
                Sprites.Draw(_bridgeBox.Image, ConvertUnits.ToDisplayUnits(body.Position), null, Color.White, body.Rotation, _bridgeBox.Origin, 1f, SpriteEffects.None, 0f);
            }

            Sprites.End();

            _border.Draw(Camera.SimProjection, Camera.SimView);

            base.Draw(gameTime);
        }
예제 #20
0
 public override void Draw(GameTime gameTime)
 {
     ScreenManager.SpriteBatch.Begin(0, null, null, null, null, null, Camera.View);
     ScreenManager.SpriteBatch.Draw(_polygonTexture, ConvertUnits.ToDisplayUnits(_compound.Position), null, Color.Tomato, _compound.Rotation, _origin, _scale, SpriteEffects.None, 0f);
     ScreenManager.SpriteBatch.End();
     _border.Draw();
     base.Draw(gameTime);
 }
예제 #21
0
        protected override void Draw(GameTime gameTime, PloobsEngine.SceneControl.RenderHelper render)
        {
            base.Draw(gameTime, render);

            border.Draw(render, this.World.Camera2D);

            render.RenderTextComplete("Objects rendered: " + World.Culler.RenderedObjectThisFrame, new Vector2(10, 10), Color.White, Matrix.Identity);
        }
예제 #22
0
 public override void Draw(GameTime gameTime)
 {
     ScreenManager.SpriteBatch.Begin(0, null, null, null, null, null, Camera.View);
     _spiderweb.Draw(ScreenManager.SpriteBatch);
     ScreenManager.SpriteBatch.End();
     _border.Draw();
     base.Draw(gameTime);
 }
예제 #23
0
    void Start()
    {
        Border border = new Border(drawValue);
        var    matrix = new int[height, width];

        border.Draw(matrix);
        new OutputConsole().Draw(matrix);
    }
예제 #24
0
 public virtual void Draw(SpriteBatch spriteBatch, Color color)
 {
     Border.Draw(
         spriteBatch,
         Bounds,
         color
         );
 }
예제 #25
0
 public override void Draw(GameTime gameTime)
 {
     ScreenManager.SpriteBatch.Begin(0, null, null, null, null, null, Camera.View);
     ScreenManager.SpriteBatch.Draw(_rectangleSprite.Texture, ConvertUnits.ToDisplayUnits(_rectangle.Position), null, Color.White, _rectangle.Rotation, _rectangleSprite.Origin, 1f, SpriteEffects.None, 0f);
     ScreenManager.SpriteBatch.End();
     _border.Draw();
     base.Draw(gameTime);
 }
예제 #26
0
        public override void Draw(GameTime gameTime)
        {
            Sprites.Begin(0, null, null, null, null, null, Camera.View);
            _webOfGoo.Draw(Sprites);
            Sprites.End();

            _border.Draw(Camera.SimProjection, Camera.SimView);

            base.Draw(gameTime);
        }
예제 #27
0
        public override void Draw(GameTime gameTime)
        {
            Sprites.Begin(0, null, null, null, null, null, Camera.View);
            Sprites.Draw(_rectangleSprite.Image, ConvertUnits.ToDisplayUnits(_rectangle.Position), null, Color.White, _rectangle.Rotation, _rectangleSprite.Origin, 1f, SpriteEffects.None, 0f);
            Sprites.End();

            _border.Draw(Camera.SimProjection, Camera.SimView);

            base.Draw(gameTime);
        }
예제 #28
0
 public override void Draw(GameTime gameTime)
 {
     ScreenManager.BatchEffect.View       = Camera.View;
     ScreenManager.BatchEffect.Projection = Camera.Projection;
     ScreenManager.SpriteBatch.Begin(SpriteSortMode.Deferred, null, null, null, RasterizerState.CullNone, ScreenManager.BatchEffect);
     ScreenManager.SpriteBatch.Draw(_rectangleSprite.Texture, _rectangle.Position, null, Color.White, _rectangle.Rotation, _rectangleSprite.Origin, _rectangleSize * _rectangleSprite.TexelSize, SpriteEffects.FlipVertically, 0f);
     ScreenManager.SpriteBatch.End();
     _border.Draw();
     base.Draw(gameTime);
 }
예제 #29
0
 public override void Draw(GameTime gameTime)
 {
     ScreenManager.BatchEffect.View       = Camera.View;
     ScreenManager.BatchEffect.Projection = Camera.Projection;
     ScreenManager.SpriteBatch.Begin(SpriteSortMode.Deferred, null, null, null, RasterizerState.CullNone, ScreenManager.BatchEffect);
     ScreenManager.SpriteBatch.Draw(_polygonTexture, _compound.Position, null, Color.Tomato, _compound.Rotation, _origin, _polygonSize / new Vector2(_polygonTexture.Width, _polygonTexture.Height), SpriteEffects.FlipVertically, 0f);
     ScreenManager.SpriteBatch.End();
     _border.Draw();
     base.Draw(gameTime);
 }
예제 #30
0
        public override void Draw(GameTime gameTime)
        {
            ScreenManager.BatchEffect.View       = Camera.View;
            ScreenManager.BatchEffect.Projection = Camera.Projection;
            ScreenManager.SpriteBatch.Begin(SpriteSortMode.Deferred, null, null, null, RasterizerState.CullNone, ScreenManager.BatchEffect);
            _spiderweb.Draw(ScreenManager.SpriteBatch);
            ScreenManager.SpriteBatch.End();

            _border.Draw();
            base.Draw(gameTime);
        }
예제 #31
0
        /// <summary>
        /// Draw the <see cref="JapaneseCandleStick"/> to the specified <see cref="Graphics"/>
        /// device at the specified location.
        /// </summary>
        /// <param name="g">
        /// A graphic device object to be drawn into.  This is normally e.Graphics from the
        /// PaintEventArgs argument to the Paint() method.
        /// </param>
        /// <param name="pane">
        /// A reference to the <see cref="GraphPane"/> object that is the parent or
        /// owner of this object.
        /// </param>
        /// <param name="isXBase">boolean value that indicates if the "base" axis for this
        /// <see cref="JapaneseCandleStick"/> is the X axis.  True for an <see cref="XAxis"/> base,
        /// false for a <see cref="YAxis"/> or <see cref="Y2Axis"/> base.</param>
        /// <param name="pixBase">The independent axis position of the center of the candlestick in
        /// pixel units</param>
        /// <param name="pixHigh">The high value position of the candlestick in
        /// pixel units</param>
        /// <param name="pixLow">The low value position of the candlestick in
        /// pixel units</param>
        /// <param name="pixOpen">The opening value position of the candlestick in
        /// pixel units</param>
        /// <param name="pixClose">The closing value position of the candlestick in
        /// pixel units</param>
        /// <param name="halfSize">The scaled width of one-half of a bar, in pixels</param>
        /// <param name="scaleFactor">
        /// The scaling factor for the features of the graph based on the <see cref="PaneBase.BaseDimension"/>.  This
        /// scaling factor is calculated by the <see cref="PaneBase.CalcScaleFactor"/> method.  The scale factor
        /// represents a linear multiple to be applied to font sizes, symbol sizes, etc.</param>
        /// <param name="pen">A pen with the <see cref="Color"/> attribute for this
        /// <see cref="JapaneseCandleStick"/></param>
        /// <param name="fill">
        /// The <see cref="Fill" /> instance to be used for filling this
        /// <see cref="JapaneseCandleStick" />
        /// </param>
        /// <param name="border">The <see cref="Border" /> instance to be used for drawing the
        /// border around the <see cref="JapaneseCandleStick" /> filled box</param>
        /// <param name="pt">The <see cref="PointPair" /> to be used for determining the
        /// <see cref="Fill" />, just in case it's a <see cref="FillType.GradientByX" />,
        /// <see cref="FillType.GradientByY" />, or
        /// <see cref="FillType.GradientByZ" /> <see cref="FillType" /></param>
        public void Draw( Graphics g, GraphPane pane, bool isXBase,
								float pixBase, float pixHigh, float pixLow,
								float pixOpen, float pixClose, float halfSize,
								float scaleFactor, Pen pen, Fill fill, Border border, PointPair pt )
        {
            //float halfSize = (int) ( _size * scaleFactor / 2.0f + 0.5f );

            if ( pixBase != PointPair.Missing && Math.Abs( pixLow ) < 1000000 &&
                        Math.Abs( pixHigh ) < 1000000)
            {
                RectangleF rect;
                if ( isXBase )
                {
                    rect = new RectangleF( pixBase - halfSize, Math.Min( pixOpen, pixClose ),
                                halfSize * 2.0f, Math.Abs( pixOpen - pixClose ) );

                    g.DrawLine( pen, pixBase, pixHigh, pixBase, pixLow );
                }
                else
                {
                    rect = new RectangleF( Math.Min( pixOpen, pixClose ), pixBase - halfSize,
                                Math.Abs( pixOpen - pixClose ), halfSize * 2.0f );

                    g.DrawLine( pen, pixHigh, pixBase, pixLow, pixBase );
                }

                if ( _isOpenCloseVisible && Math.Abs( pixOpen ) < 1000000 &&
                            Math.Abs( pixClose ) < 1000000 )
                {
                    if ( rect.Width == 0 )
                        rect.Width = 1;
                    if ( rect.Height == 0 )
                        rect.Height = 1;

                    fill.Draw( g, rect, pt );
                    border.Draw( g, pane, scaleFactor, rect );
                }
            }
        }