Ejemplo n.º 1
0
            public void Render(DwarfTime time, SpriteBatch batch)
            {
                bool isResearched     = Spell.IsResearched;
                bool parentResearched = Spell.Parent == null || Spell.Parent.IsResearched;

                if (!isResearched && parentResearched)
                {
                    float progress = Spell.ResearchProgress / Spell.ResearchTime;
                    Drawer2D.FillRect(batch, new Rectangle(ImageButton.GlobalBounds.X, ImageButton.GlobalBounds.Y - 12, (int)(ImageButton.GlobalBounds.Width * progress), 10), Color.Cyan);
                    Drawer2D.DrawRect(batch, new Rectangle(ImageButton.GlobalBounds.X, ImageButton.GlobalBounds.Y - 12, ImageButton.GlobalBounds.Width, 10), Color.Black, 1);
                }

                Vector2 line1 = new Vector2(ImageButton.GlobalBounds.X + ImageButton.GlobalBounds.Width, ImageButton.GlobalBounds.Y + ImageButton.GlobalBounds.Height / 2);

                foreach (SpellButton child in Children)
                {
                    Color drawColor = Color.DarkGray;
                    if (isResearched)
                    {
                        drawColor = Color.DarkCyan;
                    }

                    Vector2 line2 = new Vector2(child.ImageButton.GlobalBounds.X, child.ImageButton.GlobalBounds.Y + child.ImageButton.GlobalBounds.Height / 2);

                    Drawer2D.DrawLine(batch, line1, line2, drawColor, 4);
                }
            }
Ejemplo n.º 2
0
        public void Render()
        {
            if (SelectionBuffer.Count <= 0)
            {
                return;
            }

            BoundingBox superset = GetSelectionBox(0.1f);

            Drawer3D.DrawBox(superset, Mouse.GetState().LeftButton == ButtonState.Pressed ? SelectionColor : DeleteColor,
                             SelectionWidth, false);

            var     screenRect = new Rectangle(0, 0, 5, 5);
            Vector3 half       = Vector3.One * 0.5f;
            Color   dotColor   = Mouse.GetState().LeftButton == ButtonState.Pressed ? SelectionColor : DeleteColor;

            dotColor.A = 90;
            foreach (Voxel v in SelectionBuffer)
            {
                if ((SelectionType == VoxelSelectionType.SelectFilled && !v.IsEmpty) ||
                    (SelectionType == VoxelSelectionType.SelectEmpty && v.IsEmpty))
                {
                    Drawer2D.DrawRect(v.Position + half, screenRect, dotColor, Color.Transparent, 0.0f);
                }
            }
        }
Ejemplo n.º 3
0
        public override void Render(SpriteBatch batch, Camera camera, Viewport viewport)
        {
            if (batch == null || camera == null)
            {
                return;
            }

            Vector2 extents = Datastructures.SafeMeasure(Font, Text);


            Vector3 unprojected = viewport.Project(Position, camera.ProjectionMatrix, camera.ViewMatrix, Matrix.Identity);

            if (unprojected.Z > 0.999f)
            {
                return;
            }

            Rectangle rect = new Rectangle((int)(unprojected.X - extents.X / 2.0f - StrokeWeight), (int)(unprojected.Y - extents.Y / 2.0f - StrokeWeight),
                                           (int)(extents.X + StrokeWeight + 5), (int)(extents.Y + StrokeWeight + 5));

            Drawer2D.FillRect(batch, rect, FillColor);
            Drawer2D.DrawRect(batch, rect, RectStrokeColor, StrokeWeight);
            Drawer2D.SafeDraw(batch, Text, Font, StrokeColor, new Vector2(unprojected.X + 1, unprojected.Y) - extents / 2.0f, Vector2.Zero);
            Drawer2D.SafeDraw(batch, Text, Font, StrokeColor, new Vector2(unprojected.X - 1, unprojected.Y) - extents / 2.0f, Vector2.Zero);

            Drawer2D.SafeDraw(batch, Text, Font, StrokeColor, new Vector2(unprojected.X, unprojected.Y + 1) - extents / 2.0f, Vector2.Zero);
            Drawer2D.SafeDraw(batch, Text, Font, StrokeColor, new Vector2(unprojected.X, unprojected.Y - 1) - extents / 2.0f, Vector2.Zero);

            Drawer2D.SafeDraw(batch, Text, Font, TextColor, new Vector2(unprojected.X, unprojected.Y) - extents / 2.0f, Vector2.Zero);
        }
Ejemplo n.º 4
0
        public override void Update(DwarfTime gameTime, ChunkManager chunks, Camera camera)
        {
            IsAboveCullPlane = GlobalTransform.Translation.Y - GetBoundingBox().Extents().Y > (chunks.ChunkData.MaxViewingLevel + 5);
            if (DrawScreenRect)
            {
                Drawer2D.DrawRect(GetScreenRect(camera), Color.Transparent, Color.White, 1);
            }

            if (DrawBoundingBox)
            {
                Drawer3D.DrawBox(BoundingBox, Color.White, 0.02f);
                Drawer3D.DrawBox(GetRotatedBoundingBox(), Color.Red, 0.02f);
            }

            if (DrawReservation && IsReserved)
            {
                Drawer3D.DrawBox(BoundingBox, Color.White, 0.02f);
            }

            if (AnimationQueue.Count > 0)
            {
                MotionAnimation anim = AnimationQueue[0];
                anim.Update(gameTime);

                LocalTransform = anim.GetTransform();

                if (anim.IsDone())
                {
                    AnimationQueue.RemoveAt(0);
                }
            }

            base.Update(gameTime, chunks, camera);
        }
Ejemplo n.º 5
0
        public void Render()
        {
            if (SelectionBuffer.Count <= 0)
            {
                return;
            }

            BoundingBox superset = GetSelectionBox(0.1f);

            if (DrawBox)
            {
                Drawer3D.DrawBox(superset, Mouse.GetState().LeftButton == ButtonState.Pressed ? SelectionColor : DeleteColor, SelectionWidth, false);

                var     screenRect = new Rectangle(0, 0, 5, 5);
                Vector3 half       = Vector3.One * 0.5f;
                Color   dotColor   = Mouse.GetState().LeftButton == ButtonState.Pressed ? SelectionColor : DeleteColor;
                dotColor.A = 90;

                foreach (var v in SelectionBuffer)
                {
                    if (!v.IsValid)
                    {
                        continue;
                    }

                    if (!v.IsExplored || VoxelPassesSelectionCriteria(v))
                    {
                        Drawer2D.DrawRect(World.Renderer.Camera, v.WorldPosition + half, screenRect, dotColor, Color.Transparent, 0.0f);
                    }
                }
            }
        }
Ejemplo n.º 6
0
 public static void DrawLoadBar(Camera camera, Vector3 worldPos, Color backgroundColor, Color strokeColor, int width, int height, float progress)
 {
     if (!DwarfGame.HasRendered)
     {
         return;
     }
     Drawer2D.DrawRect(camera, worldPos, new Rectangle(0, 0, width, height), strokeColor, strokeColor, 1);
     Drawer2D.DrawRect(camera, worldPos, new Rectangle((int)(width * (progress)) / 2 - width / 2, 0, (int)(width * (progress)), height), backgroundColor, Color.Transparent, 1);
 }
Ejemplo n.º 7
0
        public virtual void DebugRender(DwarfTime time, SpriteBatch batch)
        {
            Drawer2D.DrawRect(batch, GlobalBounds, IsMouseOver ? Color.Red : Color.White, 1);


            foreach (GUIComponent child in Children)
            {
                child.DebugRender(time, batch);
            }
        }
Ejemplo n.º 8
0
        public override void Render(DwarfTime time, SpriteBatch batch)
        {
            int       width        = GlobalBounds.Width;
            int       height       = Text.GlobalBounds.Height - 5;
            Rectangle renderBounds = new Rectangle(Text.GlobalBounds.X, GlobalBounds.Y + 32, (int)(width * Value), height);
            Rectangle maxBounds    = new Rectangle(Text.GlobalBounds.X + 1, GlobalBounds.Y + 32 + 1, width - 1, height - 1);

            Drawer2D.FillRect(batch, renderBounds, FillColor);
            Drawer2D.DrawRect(batch, maxBounds, ForegroundColor, 1);
            base.Render(time, batch);
        }
Ejemplo n.º 9
0
        public override void Render2D(DwarfGame game, DwarfTime time)
        {
            DwarfGame.SpriteBatch.Begin();
            var entity = World.UserInterface.BodySelector.CurrentBodies.FirstOrDefault();

            if (entity != null)
            {
                Drawer2D.DrawRect(DwarfGame.SpriteBatch, GetScreenRect(entity.BoundingBox, World.Renderer.Camera), Color.White, 1.0f);
            }

            DwarfGame.SpriteBatch.End();
        }
Ejemplo n.º 10
0
        public override void Render(DwarfTime time, SpriteBatch batch)
        {
            if (DrawBackground)
            {
                Drawer2D.DrawRect(batch, GlobalBounds, BorderColor, 2);
                Drawer2D.FillRect(batch, GlobalBounds, BackColor);
            }

            if (DrawGrid)
            {
                MouseState m = Mouse.GetState();
                for (int r = 0; r < TotalRows; r++)
                {
                    for (int c = 0; c < TotalCols; c++)
                    {
                        Rectangle    rect = new Rectangle(c, r, 1, 1);
                        GUIComponent slot = Layout.ComponentPositions[rect];
                        Rectangle    draw = slot.GlobalBounds;
                        //draw.X += 5;
                        //draw.Y += 5;
                        draw.Width  += 5;
                        draw.Height += 5;
                        Drawer2D.DrawRect(batch, draw, new Color(0, 0, 0, 50), 2);

                        if (draw.Contains(m.X, m.Y))
                        {
                            Drawer2D.FillRect(batch, draw, new Color(100, 100, 0, 100));
                        }
                    }
                }
            }
            else
            {
                for (int r = 0; r < TotalRows; r++)
                {
                    for (int c = 0; c < TotalCols; c++)
                    {
                        Rectangle    rect = new Rectangle(c, r, 1, 1);
                        GUIComponent slot = Layout.ComponentPositions[rect];
                        Rectangle    draw = slot.GlobalBounds;
                        //draw.X += 5;
                        //draw.Y += 5;
                        draw.Width  += 5;
                        draw.Height += 5;
                        Drawer2D.DrawRect(batch, draw, new Color(0, 0, 0, 25), 2);
                    }
                }
            }

            base.Render(time, batch);
        }
Ejemplo n.º 11
0
        /// <summary>
        ///     Render the selection rectangle.
        /// </summary>
        /// <param name="batch">Sprite batch to render with.</param>
        public void Render(SpriteBatch batch)
        {
            if (!isLeftPressed && !isRightPressed)
            {
                return;
            }
            Color rectColor = SelectionColor;

            if (isRightPressed && AllowRightClickSelection)
            {
                rectColor = DeleteColor;
            }
            Drawer2D.DrawRect(batch, SelectionRectangle, rectColor, 4);
        }
Ejemplo n.º 12
0
        public override void Render(DwarfGame game, GraphicsDevice graphics, DwarfTime time)
        {
            DwarfGame.SpriteBatch.Begin();

            foreach (var body in Player.BodySelector.CurrentBodies)
            {
                if (IsDwarf(body))
                {
                    Drawer2D.DrawRect(DwarfGame.SpriteBatch, GetScreenRect(body.BoundingBox, Player.World.Camera), Color.White, 1.0f);
                }
            }

            DwarfGame.SpriteBatch.End();
        }
Ejemplo n.º 13
0
        public override void Render(DwarfTime time, Microsoft.Xna.Framework.Graphics.SpriteBatch batch)
        {
            Drawer2D.FillRect(batch, GlobalBounds, CurrentColor);
            if (BorderWidth > 0)
            {
                Drawer2D.DrawRect(batch, GlobalBounds, BorderColor, BorderWidth);
            }

            if (IsMouseOver)
            {
                Color highlightColor = new Color(255 - CurrentColor.R, 255 - CurrentColor.G, 255 - CurrentColor.B);
                Drawer2D.DrawRect(batch, GlobalBounds, highlightColor, BorderWidth * 2 + 1);
            }

            base.Render(time, batch);
        }
Ejemplo n.º 14
0
        public override void Render(DwarfGame game, DwarfTime time)
        {
            DwarfGame.SpriteBatch.Begin();

            foreach (var body in Player.BodySelector.CurrentBodies.Where(DrawSelectionRect))
            {
                Drawer2D.DrawRect(DwarfGame.SpriteBatch, GetScreenRect(body.BoundingBox, Player.World.Camera), Color.White, 1.0f);
            }
            if (underMouse != null)
            {
                foreach (var body in underMouse.Where(DrawSelectionRect))
                {
                    Drawer2D.DrawRect(DwarfGame.SpriteBatch, GetScreenRect(body.BoundingBox, Player.World.Camera), Color.White, 1.0f);
                }
            }

            DwarfGame.SpriteBatch.End();
        }
Ejemplo n.º 15
0
        public override void Render(DwarfTime time, SpriteBatch batch)
        {
            CalculateChildRect();
            UpdateSliders();
            if (IsVisible)
            {
                Rectangle originalRect = StartClip(batch);
                Rectangle screenRect   = ClipToScreen(GetViewRect(), batch.GraphicsDevice);
                foreach (GUIComponent child in Children)
                {
                    child.Render(time, batch);
                }
                EndClip(originalRect, batch);

                if (DrawBorder)
                {
                    Drawer2D.DrawRect(batch, screenRect, Color.Black, 1);
                }
            }
        }
Ejemplo n.º 16
0
        public override void Render(DwarfTime time, SpriteBatch batch)
        {
            AutoSize();
            Drawer2D.FillRect(batch, GlobalBounds, BackgroundColor);
            Drawer2D.DrawRect(batch, GlobalBounds, BorderColor, 2);


            int currHeight = 8;

            foreach (var entry in ColorEntries)
            {
                Vector2 measure = Font.MeasureString(entry.Key);
                Drawer2D.DrawAlignedText(batch, entry.Key, Font, TextColor, Drawer2D.Alignment.Right, new Rectangle(GlobalBounds.X + 18, GlobalBounds.Y + currHeight, LocalBounds.Width - 20, (int)measure.Y));
                Drawer2D.FillRect(batch, new Rectangle(GlobalBounds.X + 2, GlobalBounds.Y + currHeight - 5, 10, 10), entry.Value);
                Drawer2D.DrawRect(batch, new Rectangle(GlobalBounds.X + 2, GlobalBounds.Y + currHeight - 5, 10, 10), BorderColor, 1);
                currHeight += (int)(measure.Y + 5);
            }


            base.Render(time, batch);
        }
Ejemplo n.º 17
0
        public Vector2 DebugDraw(SpriteBatch batch, int x, int y)
        {
            batch.Begin();
            Vector2 offset = Vector2.Zero;
            int     k      = 0;

            foreach (var page in Pages)
            {
                Color pageColor = new HSLColor(255 * ((float)k / Pages.Count), 255, 255);
                Color cellColor = new HSLColor(255 * ((float)k / Pages.Count), 255, 128);
                Drawer2D.DrawRect(batch, new Rectangle(x + (int)offset.X, y + (int)offset.Y, page.Target.Width, page.Target.Height), pageColor, 1);
                batch.Draw(page.Target, offset + new Vector2(x, y), Color.White);
                foreach (var frame in CurrentFrames.Where(f => f.Value.Page == k))
                {
                    Drawer2D.DrawRect(batch, new Rectangle(x + (int)offset.X + frame.Value.Offset.X * page.FrameSize.X, y + (int)offset.Y + frame.Value.Offset.Y * page.FrameSize.Y, page.FrameSize.X, page.FrameSize.Y), cellColor, 1);
                }
                k++;
                offset.X += page.TargetSizeFrames.X * page.FrameSize.X;
            }
            batch.End();
            return(offset);
        }
Ejemplo n.º 18
0
        public override void Render(DwarfGame game, GraphicsDevice graphics, DwarfTime time)
        {
            DwarfGame.SpriteBatch.Begin();
            int      i    = 0;
            Viewport port = GameState.Game.GraphicsDevice.Viewport;

            foreach (CreatureAI creature in Player.SelectedMinions)
            {
                Drawer2D.DrawAlignedText(DwarfGame.SpriteBatch, creature.Stats.FullName, PlayState.GUI.SmallFont, Color.White, Drawer2D.Alignment.Right, new Rectangle(port.Width - 300, 68 + i * 24, 300, 24));
                i++;
            }

            foreach (Body body in Player.BodySelector.CurrentBodies)
            {
                if (IsDwarf(body))
                {
                    Drawer2D.DrawRect(DwarfGame.SpriteBatch, body.GetScreenRect(PlayState.Camera), Color.White, 1.0f);
                }
            }


            DwarfGame.SpriteBatch.End();
        }
Ejemplo n.º 19
0
        public static void DrawLoadBar(Camera camera, Vector3 worldPos, Color backgroundColor, Color strokeColor, int width, int height, float progress, float timeout = 0)
        {
            if (!DwarfGame.HasRendered)
            {
                return;
            }
            var cmd1 = Drawer2D.DrawRect(camera, worldPos, new Rectangle(0, 0, width, height), strokeColor, strokeColor, 1);
            var cmd2 = Drawer2D.DrawRect(camera, worldPos, new Rectangle((int)(width * (progress)) / 2 - width / 2, 0, (int)(width * (progress)), height), backgroundColor, Color.Transparent, 1);

            if (timeout > 0)
            {
                float endTime = (float)(timeout + DwarfTime.LastTime.TotalGameTime.TotalSeconds);
                if (cmd1 != null)
                {
                    cmd1.EndTime = endTime;
                }

                if (cmd2 != null)
                {
                    cmd2.EndTime = endTime;
                }
            }
        }
Ejemplo n.º 20
0
        private void GenerateData(GraphicsDevice device, float sizeX, float sizeY, float resolution)
        {
            if (banners.ContainsKey(Logo))
            {
                return;
            }

            int        numCellsX   = (int)(sizeX / resolution);
            int        numCellsY   = (int)(sizeY / resolution);
            int        numVerts    = (numCellsX + 1) * (numCellsY + 1);
            int        numIndices  = numCellsX * numCellsY * 6;
            float      aspectRatio = sizeX / sizeY;
            const int  height      = 36;
            int        width       = (int)(aspectRatio * height);
            BannerData data        = new BannerData()
            {
                Mesh    = new VertexBuffer(device, ExtendedVertex.VertexDeclaration, numVerts, BufferUsage.None),
                Indices = new IndexBuffer(device, typeof(short), numIndices, BufferUsage.None),
                Texture = new RenderTarget2D(device, width, height),
                Verts   = new ExtendedVertex[numVerts],
                SizeX   = sizeX,
                SizeY   = sizeY,
                Idx     = new ushort[numIndices]
            };

            banners[Logo] = data;
            for (int i = 0, y = 0; y <= numCellsY; y++)
            {
                for (int x = 0; x <= numCellsX; x++, i++)
                {
                    data.Verts[i] = new ExtendedVertex(new Vector3(0, y * resolution - sizeY * 0.5f, 0), Color.White, Color.White,
                                                       new Vector2((float)x / (float)numCellsX, 1.0f - (float)y / (float)numCellsY), new Vector4(0, 0, 1, 1));
                }
            }

            for (ushort ti = 0, vi = 0, y = 0; y < numCellsY; y++, vi++)
            {
                for (int x = 0; x < numCellsX; x++, ti += 6, vi++)
                {
                    data.Idx[ti]     = vi;
                    data.Idx[ti + 3] = data.Idx[ti + 2] = (ushort)(vi + 1);
                    data.Idx[ti + 4] = data.Idx[ti + 1] = (ushort)(vi + numCellsX + 1);
                    data.Idx[ti + 5] = (ushort)(vi + numCellsX + 2);
                }
            }
            var oldView = device.Viewport;

            data.Mesh.SetData(data.Verts);
            data.Indices.SetData(data.Idx);
            device.SetRenderTarget(data.Texture);
            device.Viewport = new Viewport(0, 0, width, height); // Must set viewport after target bound.
            device.Clear(new Color(Logo.LogoBackgroundColor * 0.5f + Logo.LogoSymbolColor * 0.5f));
            Texture2D logoBg = TextureManager.GetTexture("newgui/logo-bg");
            Texture2D logoFg = TextureManager.GetTexture("newgui/logo-fg");
            int       bgIdx  = Logo.LogoBackground.Tile;
            int       bgX    = (bgIdx % (logoBg.Width / 32)) * 32;
            int       bgY    = (bgIdx / (logoBg.Width / 32)) * 32;
            int       fgIdx  = Logo.LogoSymbol.Tile;
            int       fgX    = (fgIdx % (logoFg.Width / 32)) * 32;
            int       fgY    = (fgIdx / (logoFg.Width / 32)) * 32;

            DwarfGame.SpriteBatch.Begin(SpriteSortMode.Deferred, BlendState.NonPremultiplied, SamplerState.PointClamp,
                                        DepthStencilState.None, RasterizerState.CullNone);
            Drawer2D.DrawRect(DwarfGame.SpriteBatch, new Rectangle(1, 1, width - 1, height - 2), Color.Black, 2);
            DwarfGame.SpriteBatch.Draw(logoBg, new Rectangle(width / 2 - 16, height / 2 - 16, 32, 32), new Rectangle(bgX, bgY, 32, 32), new Color(Logo.LogoBackgroundColor));
            DwarfGame.SpriteBatch.Draw(logoFg, new Rectangle(width / 2 - 16, height / 2 - 16, 32, 32), new Rectangle(fgX, fgY, 32, 32), new Color(Logo.LogoSymbolColor));
            DwarfGame.SpriteBatch.End();
            device.SetRenderTarget(null);
            device.Indices = null;
            device.SetVertexBuffer(null);
            device.Viewport = oldView;
        }
Ejemplo n.º 21
0
        public override void Render(DwarfTime time, SpriteBatch batch)
        {
            if (!IsVisible)
            {
                return;
            }

            Rectangle globalBounds = GlobalBounds;
            Color     imageColor   = Color.White;
            Color     textColor    = TextColor;
            Color     strokeColor  = GUI.DefaultStrokeColor;

            if (IsLeftPressed)
            {
                imageColor = PressedTint;
                textColor  = PressedTextColor;
            }
            else if (IsMouseOver)
            {
                imageColor = HoverTint;
                textColor  = HoverTextColor;
            }

            if (CanToggle && IsToggled)
            {
                imageColor = ToggleTint;
            }

            imageColor.A = Transparency;

            Rectangle imageBounds = GetImageBounds();

            switch (Mode)
            {
            case ButtonMode.ImageButton:
                if (DrawFrame)
                {
                    GUI.Skin.RenderButtonFrame(imageBounds, batch);
                }
                Rectangle bounds = imageBounds;
                if (Image != null && Image.Image != null)
                {
                    batch.Draw(Image.Image, bounds, Image.SourceRect, imageColor);
                }

                Drawer2D.DrawAlignedText(batch, Text, TextFont, textColor, Drawer2D.Alignment.Under | Drawer2D.Alignment.Center, new Rectangle(bounds.X + 2, bounds.Y + 4, bounds.Width, bounds.Height), true);
                if (IsToggled)
                {
                    Drawer2D.DrawRect(batch, GetImageBounds(), Color.White, 2);
                }
                break;

            case ButtonMode.PushButton:
                if (DrawFrame)
                {
                    GUI.Skin.RenderButton(GlobalBounds, batch);
                }
                Drawer2D.DrawAlignedStrokedText(batch, Text,
                                                TextFont,
                                                textColor, strokeColor, Drawer2D.Alignment.Center, GlobalBounds, true);
                break;

            case ButtonMode.ToolButton:
                if (DrawFrame)
                {
                    GUI.Skin.RenderButton(GlobalBounds, batch);
                }
                if (Image != null && Image.Image != null)
                {
                    Rectangle imageRect   = GetImageBounds();
                    Rectangle alignedRect = Drawer2D.Align(GlobalBounds, imageRect.Width, imageRect.Height, Drawer2D.Alignment.Left);
                    alignedRect.X += 5;
                    batch.Draw(Image.Image, alignedRect, Image.SourceRect, imageColor);
                }
                Drawer2D.DrawAlignedStrokedText(batch, Text, TextFont, textColor, strokeColor, Drawer2D.Alignment.Center, GlobalBounds, true);

                if (IsToggled)
                {
                    Drawer2D.DrawRect(batch, GetImageBounds(), Color.White, 2);
                }

                break;

            case ButtonMode.TabButton:
                GUI.Skin.RenderTab(GlobalBounds, batch, IsToggled ? Color.White : Color.LightGray);
                Drawer2D.DrawAlignedStrokedText(batch, Text,
                                                TextFont,
                                                textColor, strokeColor, Drawer2D.Alignment.Top, new Rectangle(GlobalBounds.X, GlobalBounds.Y + 2, GlobalBounds.Width, GlobalBounds.Height), true);
                break;
            }

            base.Render(time, batch);
        }
Ejemplo n.º 22
0
 public static void DrawLoadBar(Camera camera, Vector3 worldPos, Color backgroundColor, Color strokeColor, int width, int height, float progress)
 {
     Drawer2D.DrawRect(camera, worldPos, new Rectangle(0, 0, width + 1, height + 1), Color.Transparent, strokeColor, 1);
     Drawer2D.DrawRect(camera, worldPos, new Rectangle((int)(width * (progress)) / 2 - width / 2, 0, (int)(width * (progress)), height), backgroundColor, Color.Transparent, 1);
 }
Ejemplo n.º 23
0
 public override void Render(SpriteBatch batch, Camera camera, Viewport viewport)
 {
     Drawer2D.FillRect(batch, Bounds, FillColor);
     Drawer2D.DrawRect(batch, Bounds, StrokeColor, StrokeWeight);
 }