Exemplo n.º 1
0
        public Sprite(Game game, Texture2D spriteData, Nullable<Vector2> pos = null, Nullable<Color> col = null)
            : base(game)
        {
            enabled = true;
            this.sprite = spriteData;
            transform = new Transform2D();
            spriteOrigin = new Vector2();

            if (pos.HasValue)
                transform.position = pos.Value;

            if (col.HasValue)
                color = col.Value;
            else
                color = Color.White;
        }
Exemplo n.º 2
0
        public Sprite(Game game, string spriteName, Nullable<Vector2> pos = null, Nullable<Color> col = null)
            : base(game)
        {
            enabled = true;
            assetName = spriteName;
            transform = new Transform2D();
            spriteOrigin = new Vector2();

            if (pos.HasValue)
                transform.position = pos.Value;

            if (col.HasValue)
                color = col.Value;
            else
                color = Color.White;
        }