public override void Draw(SpriteBatch spriteBatch, WorldProperties worldProperties)
        {
            if (this.Text == "")
            {
                return;
            }

            this.TextSize = this.SpriteFont.MeasureString(this.Text);

            worldProperties.Position.X *= this.ScrollFactor.X;
            worldProperties.Position.Y *= this.ScrollFactor.Y;
            worldProperties.Position.X += this.Width / 2 - this.TextSize.X / 2;
            worldProperties.Position.Y += this.Height / 2 - this.TextSize.Y / 2;

            spriteBatch.DrawString(
                this.SpriteFont,
                this.Text,
                worldProperties.Position,
                this.Color * worldProperties.Alpha,
                this.Rotation,
                this.Origin,
                this.Scale,
                this.SpriteEffects,
                Node.GetDrawDepth(this.WorldDepth));
        }
Example #2
0
 public override void DrawCall(SpriteBatch spriteBatch, WorldProperties worldProperties)
 {
     // loop through all layers to draw them
     foreach (TileLayer layer in Layers)
     {
         layer.DrawCall(spriteBatch, worldProperties);
     }
 }
        public void DrawCall(SpriteBatch spriteBatch)
        {
            WorldProperties worldProperties = new WorldProperties();

            worldProperties.Position = this.Position;
            worldProperties.Alpha    = this.Alpha;
            worldProperties.Depth    = this.Depth;

            this.DrawCall(spriteBatch, worldProperties);
        }
        public override void Draw(SpriteBatch spriteBatch, WorldProperties worldProperties)
        {
            int amountX = this.TiledWidth / this.Texture.Width;
            int amountY = this.TiledHeight / this.Texture.Height;

            WorldProperties newworldProperties = new WorldProperties();
            newworldProperties.Alpha = this.Alpha;

            for (int x = 0; x < amountX; x++)
            {
                for (int y = 0; y < amountY; y++)
                {
                    newworldProperties.Position = worldProperties.Position + new Vector2(x * this.Texture.Width * this.Scale.X, y * this.Texture.Height * this.Scale.Y);
                    base.Draw(spriteBatch, newworldProperties);
                }
            }
        }
        public override void Draw(SpriteBatch spriteBatch, WorldProperties worldProperties)
        {
            int amountX = this.TiledWidth / this.Texture.Width;
            int amountY = this.TiledHeight / this.Texture.Height;

            WorldProperties newworldProperties = new WorldProperties();

            newworldProperties.Alpha = this.Alpha;

            for (int x = 0; x < amountX; x++)
            {
                for (int y = 0; y < amountY; y++)
                {
                    newworldProperties.Position = worldProperties.Position + new Vector2(x * this.Texture.Width * this.Scale.X, y * this.Texture.Height * this.Scale.Y);
                    base.Draw(spriteBatch, newworldProperties);
                }
            }
        }
        public virtual void DrawCall(SpriteBatch spriteBatch, WorldProperties worldProperties)
        {
            if (!Visable || !Active)
            {
                return;
            }

            worldProperties.Position += this.Position;
            worldProperties.Alpha     = Math.Min(this.Alpha, worldProperties.Alpha);
            worldProperties.Depth    += this.Depth;

            int childrenCount = this.Children.Count;

            for (int i = 0; i < childrenCount; i++)
            {
                this.Children[i].DrawCall(spriteBatch, worldProperties);
            }
        }
        public virtual void Draw(SpriteBatch spriteBatch, WorldProperties worldProperties)
        {
            if (this.Texture == null)
            {
                return;
            }

            worldProperties.Position.X *= this.ScrollFactor.X;
            worldProperties.Position.Y *= this.ScrollFactor.Y;

            worldProperties.Position.X = (float)Math.Round(worldProperties.Position.X);
            worldProperties.Position.Y = (float)Math.Round(worldProperties.Position.Y);

            if (Animating)
            {
                spriteBatch.Draw(Texture,
                                 worldProperties.Position,
                                 new Rectangle(CurrentAnimation.frames[CurrentFrame] * Width, 0, Width, Height),
                                 this.Color * worldProperties.Alpha,
                                 this.Rotation,
                                 this.Origin,
                                 this.Scale,
                                 this.SpriteEffects,
                                 Node.GetDrawDepth(worldProperties.Depth));
            }
            else
            {
                spriteBatch.Draw(Texture,
                                 worldProperties.Position,
                                 this.SourceRectangle,
                                 this.Color * worldProperties.Alpha,
                                 this.Rotation,
                                 this.Origin,
                                 this.Scale,
                                 this.SpriteEffects,
                                 Node.GetDrawDepth(worldProperties.Depth));
            }
        }
        public override void DrawCall(SpriteBatch spriteBatch, WorldProperties worldProperties)
        {
            worldProperties.Position += this.Position;
            worldProperties.Alpha     = Math.Min(this.Alpha, worldProperties.Alpha);

            if (!Visable)
            {
                return;
            }

            this.SpriteEffects = SpriteEffects.None;

            if (Facing == Facing.Left)
            {
                this.SpriteEffects = SpriteEffects.FlipHorizontally;
            }

            this.Draw(spriteBatch, worldProperties);

            worldProperties.Position -= this.Position;

            base.DrawCall(spriteBatch, worldProperties);
        }
Example #9
0
        public override void Draw(SpriteBatch spriteBatch, WorldProperties worldProperties)
        {
            if (this.Text == "")
                return;

            this.TextSize = this.SpriteFont.MeasureString(this.Text);

            worldProperties.Position.X *= this.ScrollFactor.X;
            worldProperties.Position.Y *= this.ScrollFactor.Y;
            worldProperties.Position.X += this.Width / 2 - this.TextSize.X / 2;
            worldProperties.Position.Y += this.Height / 2 - this.TextSize.Y / 2;

            spriteBatch.DrawString(
                this.SpriteFont,
                this.Text,
                worldProperties.Position,
                this.Color * worldProperties.Alpha,
                this.Rotation,
                this.Origin,
                this.Scale,
                this.SpriteEffects,
                Node.GetDrawDepth(this.WorldDepth));
        }
        public override void DrawCall(SpriteBatch spriteBatch, WorldProperties worldProperties)
        {
            base.DrawCall(spriteBatch, worldProperties);

            this.DrawColor(spriteBatch);
        }
Example #11
0
        public virtual void DrawCall(SpriteBatch spriteBatch, WorldProperties worldProperties)
        {
            if (!Visable || !Active)
                return;

            worldProperties.Position += this.Position;
            worldProperties.Alpha = Math.Min(this.Alpha, worldProperties.Alpha);
            worldProperties.Depth += this.Depth;

            int childrenCount = this.Children.Count;
            for (int i = 0; i < childrenCount; i++)
                this.Children[i].DrawCall(spriteBatch, worldProperties);
        }
Example #12
0
        public void DrawCall(SpriteBatch spriteBatch)
        {
            WorldProperties worldProperties = new WorldProperties();
            worldProperties.Position = this.Position;
            worldProperties.Alpha = this.Alpha;
            worldProperties.Depth = this.Depth;

            this.DrawCall(spriteBatch, worldProperties);
        }
Example #13
0
        public override void Draw(SpriteBatch spriteBatch, WorldProperties worldProperties)
        {
            base.Draw(spriteBatch, worldProperties);

            this.DrawBorders(spriteBatch, worldProperties.Position);
        }
Example #14
0
        public override void Draw(SpriteBatch spriteBatch, WorldProperties worldProperties)
        {
            this.Texture = CurrentTexture;

            base.Draw(spriteBatch, worldProperties);
        }
Example #15
0
        public override void DrawCall(SpriteBatch spriteBatch, WorldProperties worldProperties)
        {
            worldProperties.Position += this.Position;
            worldProperties.Alpha = Math.Min(this.Alpha, worldProperties.Alpha);

            if (!Visable)
                return;

            this.SpriteEffects = SpriteEffects.None;

            if(Facing == Facing.Left)
                this.SpriteEffects = SpriteEffects.FlipHorizontally;

            this.Draw(spriteBatch, worldProperties);

            worldProperties.Position -= this.Position;

            base.DrawCall(spriteBatch, worldProperties);
        }
Example #16
0
        public virtual void Draw(SpriteBatch spriteBatch, WorldProperties worldProperties)
        {
            if (this.Texture == null)
                return;

            worldProperties.Position.X *= this.ScrollFactor.X;
            worldProperties.Position.Y *= this.ScrollFactor.Y;

            worldProperties.Position.X = (float)Math.Round(worldProperties.Position.X);
            worldProperties.Position.Y = (float)Math.Round(worldProperties.Position.Y);

            if (Animating)
                spriteBatch.Draw(Texture,
                    worldProperties.Position,
                    new Rectangle(CurrentAnimation.frames[CurrentFrame] * Width, 0, Width, Height),
                    this.Color * worldProperties.Alpha,
                    this.Rotation,
                    this.Origin,
                    this.Scale,
                    this.SpriteEffects,
                    Node.GetDrawDepth(worldProperties.Depth));
            else
                spriteBatch.Draw(Texture,
                    worldProperties.Position,
                    this.SourceRectangle,
                    this.Color * worldProperties.Alpha,
                    this.Rotation,
                    this.Origin,
                    this.Scale,
                    this.SpriteEffects,
                    Node.GetDrawDepth(worldProperties.Depth));
        }