Example #1
0
        public Bar(Vector2 position, string textureName = "playerBar", float maxValue = 100, int height = 0) : base(position, textureName, DrawManager.Layer.GUI)
        {
            barWidth = texture.Width;
            value    = MaxValue = maxValue;
            //sprite.scale = new Vector2(texture.Width, 1);

            frameTexture   = GfxManager.GetTexture("barFrame");
            frame          = new Sprite(frameTexture.Width, frameTexture.Height);
            frame.position = position;
        }
Example #2
0
 public GameObject(Vector2 spritePosition, string textureName, DrawManager.Layer drawLayer = DrawManager.Layer.Playground, int spriteWidth = 0, int spriteHeight = 0)
 {
     texture         = GfxManager.GetTexture(textureName);
     sprite          = new Sprite(spriteWidth > 0 ? spriteWidth : texture.Width, spriteHeight > 0 ? spriteHeight : texture.Height);
     sprite.position = spritePosition;
     layer           = drawLayer;
     IsActive        = true;
     UpdateManager.AddItem(this);
     DrawManager.AddItem(this);
 }