/// <summary> /// Initializes a new instance of the <see cref="Sprite" /> class /// </summary> public Sprite() { TexturePath = ""; transform = new Transform(); sprite = new SFML.Graphics.Sprite(); RenderManager.Attach(this); }
/// <summary> /// Initializes a new instance of the <see cref="Sprite" /> class /// </summary> /// <param name="texturePath">The texture path</param> public Sprite(string texturePath) { TexturePath = texturePath; transform = new Transform(); sprite = new SFML.Graphics.Sprite(new Texture(texturePath)); Size = new Vector2(sprite.TextureRect.Width, sprite.TextureRect.Height); Console.WriteLine(@$ "witdh ={Size.X} | height={Size.Y}"); RenderManager.Attach(this); }