1 module prova.graphics.sprites.sprite;
2 
3 import prova.graphics,
4        prova.math;
5 
6 ///
7 class Sprite
8 {
9   ///
10   Texture texture;
11   ///
12   Rect clip;
13   /// Defaults to the center of the sprite
14   Vector2 origin;
15   ///
16   Color tint = Color(1, 1, 1, 1);
17 
18   ///
19   this()
20   { }
21 
22   ///
23   this(string sheetpath)
24   {
25     Texture texture = Texture.fetch(sheetpath);
26     this(texture);
27   }
28 
29   ///
30   this(Texture texture)
31   {
32     this.texture = texture;
33 
34     clip.width = texture.width;
35     clip.height = texture.height;
36   }
37 }