コード例 #1
0
            protected override void Paint(PPaintContext paintContext)
            {
                float bx           = X;
                float by           = Y;
                float rightBorder  = bx + Width;
                float bottomBorder = by + Height;

                XnaGraphicsPath line = new XnaGraphicsPath();
                XnaGraphics     g    = paintContext.Graphics;

                System.Drawing.Color penColor = System.Drawing.Color.FromArgb(this.Brush.A, this.Brush.R, this.Brush.G, this.Brush.B);
                System.Drawing.Pen   pen      = new System.Drawing.Pen(penColor, 0);

                // draw vertical lines
                for (float x = bx; x < rightBorder; x += 5)
                {
                    line.Reset();
                    line.AddLine(x, by, x, bottomBorder);
                    g.DrawPath(pen, line);
                }

                for (float y = by; y < bottomBorder; y += 5)
                {
                    line.Reset();
                    line.AddLine(bx, y, rightBorder, y);
                    g.DrawPath(pen, line);
                }
            }
コード例 #2
0
ファイル: TitleButton.cs プロジェクト: duaneking/Tychaia
 public void Process(XnaGraphics xna, MouseState mouse)
 {
     if (this.m_PulseValue >= 1)
     {
         this.m_PulseModeUp = false;
     }
     else if (this.m_PulseValue <= 0)
     {
         this.m_PulseModeUp = true;
     }
     this.m_PulseValue += this.m_PulseModeUp ? 0.01 : -0.01;
     if (this.m_Area.Contains(mouse.X, mouse.Y))
     {
         if (mouse.LeftButton == ButtonState.Pressed)
         {
             this.m_IsDown = true;
         }
         if (this.m_IsDown && mouse.LeftButton != ButtonState.Pressed)
         {
             this.m_OnClick();
             this.m_IsDown = false;
         }
     }
     if (this.m_Area.Contains(mouse.X, mouse.Y))
     {
         xna.FillRectangle(this.m_Area, new Color(1f, 1f, 1f, 0.25f + (float)(this.m_PulseValue / 2.0)).ToPremultiplied());
     }
     else
     {
         xna.FillRectangle(this.m_Area, new Color(1f, 1f, 1f, 0.1f + (float)(this.m_PulseValue / 32.0)).ToPremultiplied());
     }
     xna.DrawStringCentered(this.m_Area.X + this.m_Area.Width / 2, this.m_Area.Y + 4, this.m_Text, "ButtonFont");
 }
コード例 #3
0
        public override void DrawAbove(GameContext context)
        {
            XnaGraphics xna = new XnaGraphics(context);

            xna.DrawStringCentered(context.ScreenBounds.Width / 2, 50, "Tychaia", "TitleFont");

            // TODO: Draw animation of player falling here.
            xna.DrawSprite(
                context.ScreenBounds.Width / 2,
                context.ScreenBounds.Height / 2,
                "chars.player.player");

            MouseState state = Mouse.GetState();

            foreach (TitleButton b in this.m_Buttons)
            {
                b.Process(xna, state);
            }

            /*xna.DrawStringCentered(
             *  context.ScreenBounds.Width / 2,
             *  context.ScreenBounds.Height - 50,
             *  "Using static seed: " + m_StaticSeed.ToString(),
             *  "Arial");*/

            // Draw debug information.
            //DebugTracker.Draw(context, null);
        }
コード例 #4
0
            protected override void Paint(PPaintContext paintContext)
            {
                // make sure grid gets drawn on snap to grid boundaries. And
                // expand a little to make sure that entire view is filled.
                float bx           = (X - (X % gridSpacing)) - gridSpacing;
                float by           = (Y - (Y % gridSpacing)) - gridSpacing;
                float rightBorder  = X + Width + gridSpacing;
                float bottomBorder = Y + Height + gridSpacing;

                XnaGraphics g    = paintContext.Graphics;
                RectangleFx clip = paintContext.LocalClip;

                for (float x = bx; x < rightBorder; x += gridSpacing)
                {
                    gridLine.Reset();
                    gridLine.AddLine(x, by, x, bottomBorder);
                    if (PUtil.RectIntersectsPerpLine(clip, x, by, x, bottomBorder))
                    {
                        g.DrawPath(gridPen, gridLine);
                    }
                }

                for (float y = by; y < bottomBorder; y += gridSpacing)
                {
                    gridLine.Reset();
                    gridLine.AddLine(bx, y, rightBorder, y);
                    if (PUtil.RectIntersectsPerpLine(clip, bx, y, rightBorder, y))
                    {
                        g.DrawPath(gridPen, gridLine);
                    }
                }
            }
コード例 #5
0
 /// <summary>
 /// Overridden.  Pops the clip from the paint context and then renders the outline
 /// of this node.
 /// </summary>
 /// <param name="paintContext">
 /// The paint context to use for painting this node.
 /// </param>
 protected override void PaintAfterChildren(PPaintContext paintContext)
 {
     paintContext.PopClip();
     if (Pen != null)
     {
         XnaGraphics g = paintContext.Graphics;
         g.DrawPath(Pen, PathReference);
     }
 }
コード例 #6
0
ファイル: PImage.cs プロジェクト: templeblock/fyri2deditor
        //****************************************************************
        // Painting - Methods for painting a PImage.
        //****************************************************************

        /// <summary>
        /// Overridden.  See <see cref="PNode.Paint">PNode.Paint</see>.
        /// </summary>
        protected override void Paint(PPaintContext paintContext)
        {
            if (Image != null)
            {
                RectangleFx b = Bounds;
                XnaGraphics g = paintContext.Graphics;

                g.DrawImage(image, b.ToRectangleF());
            }
        }
コード例 #7
0
        //****************************************************************
        // Painting - Methods for painting a PImage.
        //****************************************************************

        /// <summary>
        /// Overridden.  See <see cref="PNode.Paint">PNode.Paint</see>.
        /// </summary>
        protected override void Paint(PPaintContext paintContext)
        {
            if (rect != null)
            {
                RectangleFx b = Bounds;
                XnaGraphics g = paintContext.Graphics;

                g.DrawRectangle(this.Brush, rect);
            }
        }
コード例 #8
0
        public void Draw(RTSWorld world, GameContext context, XnaGraphics graphics)
        {
            this.Update(world, context);

            graphics.DrawStringLeft(0, 0, world.ActiveLevel.GetType().Name);
            graphics.DrawStringLeft(0, 32, this.m_Tick.ToString());

            if (this.m_LastMousePoint.HasValue && this.m_CurrentMousePoint.HasValue)
            {
                graphics.DrawRectangle(this.m_LastMousePoint.Value, this.m_CurrentMousePoint.Value, Color.LimeGreen);
            }

            foreach (Unit u in this.Selected)
            {
                Rectangle bb = new Rectangle((int)u.X, (int)u.Y - 1, u.Width + 1, u.Height + 1);
                if (u.Team != null)
                {
                    graphics.DrawRectangle(bb, u.Team.Color);
                }
                else
                {
                    graphics.DrawRectangle(bb, Color.LimeGreen);
                }
            }

            // Draw chat.
            int a = 16;

            for (int i = this.m_ChatMessages.Count - 1; i >= Math.Max(this.m_ChatMessages.Count - 11, 0); i--)
            {
                if (i < this.m_ChatMessages.Count)
                {
                    graphics.DrawStringLeft(0, context.Graphics.GraphicsDevice.Viewport.Height - a, this.m_ChatMessages[i]);
                }
                a += 16;
            }

            // Draw graph.
            if (this.m_GraphFrames.Count > 1)
            {
                for (int i = 1; i < this.m_GraphFrames.Count; i++)
                {
                    graphics.DrawLine(i - 1, (float)this.m_GraphFrames[i - 1], i, (float)this.m_GraphFrames[i], 1, Color.Lime);
                }
            }

            // Add frame information.
            if (this.m_GraphFrames.Count > 200)
            {
                this.m_GraphFrames.RemoveAt(0);
            }
            this.m_GraphFrames.Add(context.GameTime.ElapsedGameTime.TotalMilliseconds);

            this.m_Tick++;
        }
コード例 #9
0
        public override void Draw(World world, XnaGraphics graphics)
        {
            base.Draw(world, graphics);

            if (this.Width == 16 && this.CurrentHealth > 0 && this.MaxHealth > 0)
            {
                graphics.DrawSprite((int)this.X, (int)this.Y, this.Width, this.Height, "meters.health.i" + ((int)(16 - (this.CurrentHealth / this.MaxHealth * 15))).ToString(), Color.White, false);
            }

            // You can override to show more meters in subclasses.
        }
コード例 #10
0
        protected override void Paint(PPaintContext paintContext)
        {
            if (Brush != Color.Transparent)
            {
                XnaGraphics g = paintContext.Graphics;

                RectangleFx bounds = UnionOfChildrenBounds;
                bounds = new RectangleFx(bounds.X - INDENT, bounds.Y - INDENT, bounds.Width + 2 * INDENT, bounds.Height + 2 * INDENT);
                g.FillRectangle(Brush, bounds);
            }
        }
コード例 #11
0
        public override void DrawBelow(GameContext context)
        {
            this.AdjustButtons(context);

            // Draw background effects.
            XnaGraphics xna = new XnaGraphics(context);

            xna.FillRectangle(
                context.ScreenBounds,
                Color.Black);
        }
コード例 #12
0
 protected override void Paint(PPaintContext paintContext)
 {
     if (fIsPressed)
     {
         XnaGraphics g = paintContext.Graphics;
         g.FillRectangle(this.Brush, this.Bounds);
     }
     else
     {
         base.Paint(paintContext);
     }
 }
コード例 #13
0
 /// <summary>
 /// Overridden.  Paints the cached image representation of this node's children if
 /// it is not currently being created.
 /// </summary>
 /// <param name="paintContext"></param>
 public override void FullPaint(PPaintContext paintContext)
 {
     if (validatingCache)
     {
         base.FullPaint(paintContext);
     }
     else
     {
         XnaGraphics g = paintContext.Graphics;
         g.DrawImage(ImageCache, (int)X, (int)Y);
     }
 }
コード例 #14
0
 protected override void Paint(PPaintContext paintContext)
 {
     if (paintContext.Camera == lens.Camera)
     {
         XnaGraphics g = paintContext.Graphics;
         g.FillRectangle(Color.Red, Bounds);
     }
     else
     {
         base.Paint(paintContext);
     }
 }
コード例 #15
0
        /// <summary>
        /// Constructs a new PPaintContext.
        /// </summary>
        /// <param name="graphics">
        /// The graphics context to associate with this paint context.
        /// </param>
        /// <param name="canvas">The canvas that the paint context will render on.</param>
        public PPaintContext(XnaGraphics graphics, PCanvas canvas)
        {
            this.graphics         = graphics;
            this.canvas           = canvas;
            clipStack             = new Stack();
            localClipStack        = new Stack();
            cameraStack           = new Stack();
            transformStack        = new Stack();
            RenderQuality         = RenderQuality.HighQuality;
            CURRENT_PAINT_CONTEXT = this;

            InitializeStacks();
        }
コード例 #16
0
        /// <summary>
        /// Overridden.  Renders the fill for this node and then pushes the clip onto the
        /// paint context, so that when this node's children are rendered they will be
        /// clipped accordingly.
        /// </summary>
        /// <param name="paintContext">
        /// The paint context to use for painting this node.
        /// </param>
        protected override void Paint(PPaintContext paintContext)
        {
            Color b = Brush;

            if (b != null)
            {
                XnaGraphics g = paintContext.Graphics;
                g.FillPath(this.Matrix, b, this.PathReference);
            }
            //TEMP_REGION.MakeInfinite();
            //TEMP_REGION.Intersect(PathReference);
            paintContext.PushClip(TEMP_REGION);
        }
コード例 #17
0
ファイル: DebugTracker.cs プロジェクト: duaneking/Tychaia
        public static void Draw(GameContext context, RPGWorld world)
        {
            XnaGraphics g = new XnaGraphics(context);

            g.FillRectangle(new Rectangle(0, 0, 300, 200), Color.Black);
            g.DrawRectangle(new Rectangle(0, 0, 300, 200), Color.Gray);
            g.DrawStringLeft(20, 20, "Render targets used: " + RenderTargetFactory.RenderTargetsUsed);
            g.DrawStringLeft(20, 20 + 16, "Render targets memory: " + RenderTargetFactory.RenderTargetMemory / (1 * 1024 * 1024) + "MB");
            if (world != null)
            {
                TimeSpan ts = new TimeSpan((long)((RPGWorld.AUTOSAVE_LIMIT - world.m_AutoSave) / 60.0 * 10000000.0));
                g.DrawStringLeft(20, 20 + 32, "Autosave counter: " + ts.Minutes + "m" + ts.Seconds + "s");
            }
        }
コード例 #18
0
        public override void DrawAbove(GameContext context)
        {
            if (this.m_FadeAmount < 1.0f)
            {
                base.DrawAbove(context);
            }

            var graphics = new XnaGraphics(context);

            graphics.FillRectangle(
                context.ScreenBounds,
                new Color(0, 0, 0, this.m_FadeAmount));
            this.m_FadeAmount -= 0.01f;
        }
コード例 #19
0
        public override void DrawAbove(GameContext context)
        {
            XnaGraphics xna = new XnaGraphics(context);

            xna.DrawStringLeft(8, 8, "FPS: " + context.FPS, "Arial");

            // Draw UI.
            xna.DrawSprite(context.Camera.Width / 2 - xna.SpriteWidth("ui.frame") / 2,
                           context.Camera.Height - xna.SpriteHeight("ui.frame"),
                           "ui.frame");

            // Draw debug information.
            DebugTracker.Draw(context, this);
        }
コード例 #20
0
ファイル: PPath.cs プロジェクト: templeblock/fyri2deditor
        //****************************************************************
        // Painting - Methods for painting a PPath.
        //****************************************************************

        /// <summary>
        /// Overridden.  See <see cref="PNode.Paint">PNode.Paint</see>.
        /// </summary>
        protected override void Paint(PPaintContext paintContext)
        {
            //System.Drawing.Brush b = this.Brush;
            XnaGraphics g = paintContext.Graphics;

            if (this.Brush != Color.Transparent)
            {
                //PointFx transformedPosition = MatrixExtensions.Transform(this.Matrix, new PointFx(1.0f, 1.0f));
                g.FillPath(this.Matrix, this.Brush, path);
            }

            if (pen != null)
            {
                g.DrawPath(pen, path);
            }
        }
コード例 #21
0
        /// <summary>
        /// This method is called when the render quality is set to low.
        /// </summary>
        /// <param name="graphics">
        /// The graphics context associated with this paint context.
        /// </param>
        /// <param name="canvas">The canvas that this paint context will render on.</param>
        /// <remarks>
        /// Override this method to change how the low render quality is set.
        /// </remarks>
        protected virtual void OnLowRenderQuality(XnaGraphics graphics, PCanvas canvas)
        {
            // Set default low quality flags.
            graphics.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.Low;
            graphics.SmoothingMode     = System.Drawing.Drawing2D.SmoothingMode.HighSpeed;
            graphics.TextRenderingHint = GridFitText ? TextRenderingHint.SingleBitPerPixelGridFit
                                : TextRenderingHint.SingleBitPerPixel;
            graphics.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighSpeed;
            graphics.PixelOffsetMode    = System.Drawing.Drawing2D.PixelOffsetMode.HighSpeed;

            // Notify the canvas.
            if (canvas != null && canvas.LowRenderQuality != null)
            {
                canvas.LowRenderQuality(graphics);
            }
        }
コード例 #22
0
        /// <summary>
        /// This method is called when the render quality is set to high.
        /// </summary>
        /// <param name="graphics">
        /// The graphics context associated with this paint context.
        /// </param>
        /// <param name="canvas">The canvas that this paint context will render on.</param>
        /// <remarks>
        /// Override this method to change how the high render quality is set.
        /// </remarks>
        protected virtual void OnHighRenderQuality(XnaGraphics graphics, PCanvas canvas)
        {
            // Set default high quality flags.
            graphics.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
            graphics.SmoothingMode     = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
            graphics.TextRenderingHint = GridFitText ? TextRenderingHint.AntiAliasGridFit :
                                         TextRenderingHint.AntiAlias;
            graphics.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality;
            graphics.PixelOffsetMode    = System.Drawing.Drawing2D.PixelOffsetMode.HighQuality;

            // Notify the canvas.
            if (canvas != null && canvas.HighRenderQuality != null)
            {
                canvas.HighRenderQuality(graphics);
            }
        }
コード例 #23
0
        /// <summary>
        /// Overridden.  See <see cref="PNode.Paint">PNode.Paint</see>.
        /// </summary>
        protected override void Paint(PPaintContext paintContext)
        {
            XnaGraphics g = paintContext.Graphics;

            float  x         = X;
            float  y         = Y;
            float  width     = Width;
            float  height    = Height;
            Matrix transform = g.Transform;

            float[] elements = MatrixExtensions.GetElements(transform);
            float   magX     = elements[0];
            float   magY     = elements[3];
            float   dx       = (float)(1.0 / magX);
            float   dy       = (float)(1.0 / magY);

            g.FillRectangle(Brush, Bounds);

            path.Reset();
            path.AddLine((float)(x + width), (float)y, (float)x, (float)y);
            path.AddLine((float)x, (float)y, (float)x, (float)(y + height));
            pen.Color = System.Drawing.Color.FromArgb(topLeftOuterColor.A, topLeftOuterColor.R, topLeftOuterColor.G, topLeftOuterColor.B);
            g.DrawPath(pen, path);

            path.Reset();
            path.AddLine((float)(x + width), (float)(y + dy), (float)(x + dx), (float)(y + dy));
            path.AddLine((float)(x + dx), (float)(y + dy), (float)(x + dx), (float)(y + height));
            pen.Color = System.Drawing.Color.FromArgb(topLeftInnerColor.A, topLeftInnerColor.R, topLeftInnerColor.G, topLeftInnerColor.B);
            g.DrawPath(pen, path);

            path.Reset();
            path.AddLine((float)(x + width), (float)(y), (float)(x + width), (float)(y + height));
            path.AddLine((float)(x + width), (float)(y + height), (float)(x), (float)(y + height));
            pen.Color = System.Drawing.Color.FromArgb(bottomRightOuterColor.A, bottomRightOuterColor.R, bottomRightOuterColor.G, bottomRightOuterColor.B);
            g.DrawPath(pen, path);

            path.Reset();
            path.AddLine((float)(x + width - dx), (float)(y + dy), (float)(x + width - dx), (float)(y + height - dy));
            path.AddLine((float)(x + width - dx), (float)(y + height - dy), (float)(x), (float)(y + height - dy));
            pen.Color = System.Drawing.Color.FromArgb(bottomRightInnerColor.A, bottomRightInnerColor.R, bottomRightInnerColor.G, bottomRightInnerColor.B);
            g.DrawPath(pen, path);
        }
コード例 #24
0
        /// <summary>
        /// Overridden.  See <see cref="PNode.Paint">PNode.Paint</see>.
        /// </summary>
        protected override void Paint(PPaintContext paintContext)
        {
            base.Paint(paintContext);

            XnaGraphics g          = paintContext.Graphics;
            Matrix      matrix     = g.Transform;
            RectangleFx transRectF = MatrixExtensions.Transform(matrix, bounds);

            System.Drawing.Rectangle transRect = new System.Drawing.Rectangle((int)transRectF.X, (int)transRectF.Y, (int)transRectF.Width, (int)transRectF.Height);

            // Draw the image if the control node is not in editing mode or
            // if the control is being rendered in a view other than the one
            // that owns the control.
            if (!Editing || control.Bounds != transRect || paintContext.Canvas != currentCanvas)
            {
                if (image != null)
                {
                    g.DrawImage(image, bounds.ToRectangleF());
                }
            }
        }
コード例 #25
0
ファイル: PathFindingLevel.cs プロジェクト: duaneking/Tychaia
 protected void DrawDebugPathFindingGrid(GameContext context, XnaGraphics graphics)
 {
     for (int x = 0; x < this.m_PathFindingGrid.GetLength(0); x++)
     {
         for (int y = 0; y < this.m_PathFindingGrid.GetLength(1); y++)
         {
             if (this.m_PathFindingGrid[x, y] == (byte)PathFinderHelper.BLOCKED_TILE)
             {
                 graphics.DrawRectangle(new Rectangle(x * 16, y * 16, 16, 16), new Color(255, 0, 0, 128));
             }
             else if (this.m_PathFindingGrid[x, y] == (byte)PathFinderHelper.EMPTY_TILE)
             {
                 graphics.DrawRectangle(new Rectangle(x * 16, y * 16, 16, 16), new Color(0, 255, 0, 128));
             }
             else
             {
                 graphics.DrawRectangle(new Rectangle(x * 16, y * 16, 16, 16), new Color(0, 0, 255, 128));
             }
         }
     }
 }
コード例 #26
0
        public override void DrawAbove(GameContext context)
        {
            // Are we waiting for players?
#if MULTIPLAYER
            if (this.m_GlobalSession.Waiting || (this.m_GlobalSession.LoadingInitialData && !LocalNode.Singleton.IsServer))
#else
            if (this.m_GlobalSession.Waiting)
#endif
            {
                XnaGraphics graphics = new XnaGraphics(context);
                graphics.FillRectangle(new Rectangle(0, 0, context.Graphics.GraphicsDevice.Viewport.Width, context.Graphics.GraphicsDevice.Viewport.Height), Color.Black);
                int dialogX = context.Graphics.GraphicsDevice.Viewport.X + context.Graphics.GraphicsDevice.Viewport.Width / 2 - 300;
                int dialogY = context.Graphics.GraphicsDevice.Viewport.Y + context.Graphics.GraphicsDevice.Viewport.Height / 2 - 200;
                graphics.FillRectangle(new Rectangle(dialogX, dialogY, 600, 400), Color.DarkSlateGray);
                graphics.DrawStringCentered(dialogX + 300, dialogY + 8, this.m_GlobalSession.LobbyMessage, "BigArial");
                graphics.DrawStringCentered(dialogX + 300, dialogY + 32, "Press enter to toggle ready status.");
                int a = 0;
                for (int i = 0; i < this.m_GlobalSession.Players.Count; i++)
                {
                    Player p = this.m_GlobalSession.Players[i];
                    if (p.Ready)
                    {
                        graphics.DrawStringLeft(dialogX + 8, dialogY + 48 + a * 16, "Player " + a + " (" + p.PlayerID + ") ready.");
                    }
                    else
                    {
                        graphics.DrawStringLeft(dialogX + 8, dialogY + 48 + a * 16, "Player " + a + " (" + p.PlayerID + ") not ready.");
                    }
                    a++;
                }
                return;
            }

            // Handle game normally.
            if (this.m_ActiveLevel != null)
            {
                this.m_ActiveLevel.DrawAbove(context);
            }
            this.m_UiManager.Draw(this, context, new XnaGraphics(context));
        }
コード例 #27
0
ファイル: PText.cs プロジェクト: templeblock/fyri2deditor
        //****************************************************************
        // Painting - Methods for painting a PText.
        //****************************************************************

        /// <summary>
        /// Overridden.  See <see cref="PNode.Paint">PNode.Paint</see>.
        /// </summary>
        protected override void Paint(XnaPiccolo.Util.PPaintContext paintContext)
        {
            //Font font = new Font("Arial", 12);
            //XnaGraphics gg = paintContext.Graphics;
            //gg.DrawString("Before BasePaint", font, Brushes.Red, new PointF(10, 50));
            //gg.Flush();

            base.Paint(paintContext);

            if (text != null && textBrush != null && font != null)
            {
                XnaGraphics g = paintContext.Graphics;

                float renderedFontSize = font.MeasureString(text).Y * 1.0f;
                //float renderedFontSize = font.SizeInPoints * paintContext.Scale;
                if (renderedFontSize < PUtil.GreekThreshold)
                {
                    // .NET bug: DrawString throws a generic gdi+ exception when
                    // the scaled font size is very small.  So, we will render
                    // the text as a simple rectangle for small fonts
                    g.FillRectangle(textBrush, Bounds);
                }
                else if (renderedFontSize < PUtil.MaxFontSize)
                {
                    SpriteFont renderFont = font;

                    // The font needs to be adjusted for printing.
                    if (g.DpiY != GRAPHICS.DpiY)
                    {
                        float fPrintedFontRatio = GRAPHICS.DpiY / 100;
                        //renderFont = new Font(font.Name, font.Size * fPrintedFontRatio,
                        //	font.Style, font.Unit);
                    }

                    g.DrawString(text, renderFont, textBrush, Bounds, stringFormat);
                }
            }
        }
コード例 #28
0
 public override void Draw(World world, XnaGraphics graphics)
 {
     graphics.DrawSprite(
         (int)this.X,
         (int)this.Y,
         (int)(TileIsometricifier.TILE_TOP_WIDTH * 2.0 / this.m_Distance),
         (int)(TileIsometricifier.TILE_TOP_HEIGHT * 2.0 / this.m_Distance),
         "tiles.grass.isometric.top",
         new Color(1.0f, 1.0f, 1.0f, 1.0f - (m_Distance / 100.0f)));
     graphics.DrawSprite(
         (int)this.X + (int)(TileIsometricifier.TILE_SIDE_WIDTH * 2.0 / this.m_Distance),
         (int)this.Y + (int)(TileIsometricifier.TILE_TOP_HEIGHT / this.m_Distance),
         (int)(TileIsometricifier.TILE_SIDE_WIDTH * 2.0 / this.m_Distance),
         (int)(TileIsometricifier.TILE_SIDE_HEIGHT * 2.0 / this.m_Distance),
         "tiles.sand.isometric.sideL",
         new Color(1.0f, 1.0f, 1.0f, 1.0f - (m_Distance / 100.0f)));
     graphics.DrawSprite(
         (int)this.X,
         (int)this.Y + (int)(TileIsometricifier.TILE_TOP_HEIGHT / this.m_Distance),
         (int)(TileIsometricifier.TILE_SIDE_WIDTH * 2.0 / this.m_Distance),
         (int)(TileIsometricifier.TILE_SIDE_HEIGHT * 2.0 / this.m_Distance),
         "tiles.sand.isometric.sideR",
         new Color(1.0f, 1.0f, 1.0f, 1.0f - (m_Distance / 100.0f)));
 }
コード例 #29
0
ファイル: PCamera.cs プロジェクト: templeblock/fyri2deditor
        /// <summary>
        /// Override this method to change the way the bounds are painted when the debug bounds
        /// flag is set.
        /// </summary>
        /// <param name="paintContext">The paint context to use for painting debug information.</param>
        /// <param name="boundsPen">The pen to use for painting the bounds of a node.</param>
        /// <param name="nodeBounds">The bounds of the node to paint.</param>
        protected virtual void PaintDebugBounds(PPaintContext paintContext, System.Drawing.Pen boundsPen, RectangleFx nodeBounds)
        {
            XnaGraphics g = paintContext.Graphics;

            g.DrawRectangle(boundsPen, nodeBounds.X, nodeBounds.Y, nodeBounds.Width, nodeBounds.Height);
        }
コード例 #30
0
ファイル: PCamera.cs プロジェクト: templeblock/fyri2deditor
        /// <summary>
        /// Override this method to change the way the full bounds are painted when the debug
        /// full bounds flag is set.
        /// </summary>
        /// <param name="paintContext">The paint context to use for painting debug information.</param>
        /// <param name="fullBoundsBrush">The brush to use for painting the full bounds of a node.</param>
        /// <param name="nodeBounds">The full bounds of the node to paint.</param>
        protected virtual void PaintDebugFullBounds(PPaintContext paintContext, Color fullBoundsBrush, RectangleFx nodeBounds)
        {
            XnaGraphics g = paintContext.Graphics;

            g.FillRectangle(fullBoundsBrush, nodeBounds);
        }