protected override void Dispose(bool disposing)
        {
            if (m_disposed || !Initialized)
            {
                return;
            }

            if (disposing)
            {
                if (m_bodyShape != null)
                {
                    m_bodyShape.Dispose();
                }
                if (m_bodyFillShape != null)
                {
                    m_bodyFillShape.Dispose();
                }
                if (m_trackShape != null)
                {
                    m_trackShape.Dispose();
                }
                if (m_barrelShape != null)
                {
                    m_barrelShape.Dispose();
                }
                if (m_turretShape != null)
                {
                    m_turretShape.Dispose();
                }
            }

            m_disposed = true;
            base.Dispose(disposing);
        }
Beispiel #2
0
        public override void Dispose()
        {
            base.Dispose();

            rectangle.Texture.Dispose();
            rectangle.Dispose();
        }
Beispiel #3
0
 public override void Remove()
 {
     base.Remove();
     if (shpBackground != null)
     {
         shpBackground.Dispose();
         shpBackground = null;
     }
 }
Beispiel #4
0
        protected override void OnDispose()
        {
            texture.Dispose();
            rectRender.Dispose();

            foreach (var sprite in sprites)
            {
                sprite.Dispose();
            }
        }
Beispiel #5
0
        public override void Render(RenderTarget buffer, Texture texture)
        {
            RectangleShape shape = new RectangleShape(Size);

            shape.FillColor = Color;
            shape.Position  = Position;

            buffer.Draw(shape);
            shape.Dispose();
        }
Beispiel #6
0
        //private static bool coordsIn(Vector2i c1, Vector2i c2)
        //{
        //    return (c2.X > )
        //}
        private static RectangleShape DrawSquare(int x, int y, RenderWindow w, Color color, int size = SQUARE_SIZE)
        {
            RectangleShape s = new RectangleShape(new Vector2f(size, size));

            s.Position  = new Vector2f((float)x, (float)y);
            s.FillColor = color;
            //Console.WriteLine(x + "--" + y);

            w.Draw(s);
            s.Dispose();
            return(s);
        }
Beispiel #7
0
        public virtual void Draw(RenderTarget target, RenderStates states)
        {
            RectangleShape rect = new RectangleShape(Size)
            {
                Origin       = new Vector2f(0, Size.Y / 2),
                Rotation     = Rotation,
                Position     = Position,
                FillColor    = Selected ? Color.Yellow : FillColor,
                OutlineColor = OutlineColor
            };

            target.Draw(rect, states);
            rect.Dispose();
        }
        protected override void OnDispose()
        {
            colliderRect.Dispose();

            base.OnDispose();
        }
Beispiel #9
0
 public void RemoveEntry()
 {
     RegionHighlight.Dispose();
     this.Dispose();
 }
Beispiel #10
0
 public void Dispose()
 {
     _button.Dispose();
     _text.Dispose();
     _font.Dispose();
 }
Beispiel #11
0
 public void Dispose()
 {
     _hpBarMeter.Dispose();
     _hpBarBackground.Dispose();
 }
Beispiel #12
0
 public override void OnDestroy()
 {
     shape.Dispose();
 }
Beispiel #13
0
        public void UpdateATH(View view, uint mapWidth, uint mapHeigth)
        {
            if (_ctx._boss != null && _ctx._boss.isDead == false)
            {
                _HPboss.Position           = new Vector2f(view.Center.X - 200, view.Center.Y - 300);
                _athBossBarsprite.Position = new Vector2f(_HPboss.Position.X - 90, _HPboss.Position.Y - 15);
                _HPboss.Size = new Vector2f(_ctx._boss.BossLife * 300 / _ctx._boss.BossMaxlife, 40);
                if (_ctx._boss.isDead == true)
                {
                    _athBossBarsprite.Dispose();
                    _HPboss.Dispose();
                }
            }

            int  b = 3;
            bool a = true;

            for (int i = 0; i < _athList.Count; i++)
            {
                if (i > 1)
                {
                    if (a == true)
                    {
                        b = 2;
                    }
                    _athList[i].Position = new Vector2f(view.Center.X - view.Size.X / b, view.Center.Y - view.Size.Y / 2);
                    a = false;
                }
                else
                {
                    _athList[i].Position = new Vector2f(view.Center.X + view.Size.X / 3, (view.Center.Y - view.Size.Y / b));
                }

                b++;
            }

            _HPbar.Size = new Vector2f((this._ctx.Player.LifePlayer * 271 / this._ctx.Player.LifePlayerMax), 40);
            _XPbar.Size = new Vector2f((this._ctx.Player.Experience * 271 / this._ctx.Player.ExperienceMax), 25);


            //  _HPbar.Size = new Vector2f((this._ctx.Player.CurrentWeapon.Ammo*275 /30), 40);
            _athGun.Dispose();
            _athGunSprite.Dispose();
            _athGun       = new Texture("../../../../Images/HUD/" + this._ctx.Player.CurrentWeapon.Name + ".png");
            _athGunSprite = new Sprite(_athGun);

            //player life
            _athList[0].DisplayedString = Math.Round(this._ctx.Player.LifePlayer).ToString() + "/" + this._ctx.Player.LifePlayerMax.ToString();

            //bullet count
            _athList[1].DisplayedString = this._ctx.Player.CurrentWeapon.Ammo.ToString() + "/" + this._ctx.Player.CurrentWeapon.MaxAmmo.ToString();

            //money
            _athList[2].DisplayedString = "Ω " + this._ctx.Player.Points.ToString();

            //current lvl
            _athList[3].DisplayedString = "Lvl: " + this._ctx.Player.Level.ToString();

            //current XP
            _athList[4].DisplayedString = this._ctx.Player.Experience.ToString() + "/" + this._ctx.Player.ExperienceMax.ToString();

            //current Effect
            string effectOnAth;

            if (_ctx.Player.Effect == "nothing" && _ctx.Player.Speed == 0.005f)
            {
                effectOnAth = "";
            }
            else if (_ctx.Player.Effect == "nothing")
            {
                effectOnAth = "";
            }
            else
            {
                effectOnAth = _ctx.Player.Effect;
            }
            _athList[5].DisplayedString = "Effect:" + effectOnAth;

            //Current stage
            _athList[6].DisplayedString = "Stage: " + _ctx.Level.ToString() + " - " + _ctx.Stage.ToString();

            //Current stage
            _athList[7].DisplayedString = "Package: " + _ctx.StuffFactories[_ctxUI.GameCtx.Input.StuffFactories].Name;



            _athLifeSprite.Position = new Vector2f(_athList[0].Position.X - 100, _athList[0].Position.Y - 100);
            _athGunSprite.Position  = new Vector2f(_athLifeSprite.Position.X + 170, _athLifeSprite.Position.Y - 10);
            _XPbar.Position         = new Vector2f(_athList[0].Position.X - 87, _athList[0].Position.Y + 20);
            _HPbar.Position         = new Vector2f(_athList[0].Position.X - 85, _athList[0].Position.Y - 20);


            _athList[0].Position = new Vector2f(_athList[0].Position.X + 10, _athList[0].Position.Y - 20);
            _athList[1].Position = new Vector2f(_athGunSprite.Position.X - 80, _athGunSprite.Position.Y + 20);
            _athList[2].Position = new Vector2f(_athList[0].Position.X + 70, _athList[0].Position.Y + 70);
            _athList[3].Position = new Vector2f(_athList[0].Position.X - 70, _athList[0].Position.Y + 70);
            _athList[4].Position = new Vector2f(_athList[0].Position.X + 10, _athList[0].Position.Y + 40);
            _athList[5].Position = new Vector2f(_athList[0].Position.X - 70, _athList[0].Position.Y + 100);
            _athList[6].Position = new Vector2f(_athList[0].Position.X - 1000, _athList[0].Position.Y - 80);
            _athList[7].Position = new Vector2f(_athList[0].Position.X, _athList[0].Position.Y + 500);
        }
Beispiel #14
0
 public void Dispose()
 {
     target.Dispose();
     targetLineX.Dispose();
     targetLineY.Dispose();
 }