OLD | NEW |
1 part of sprites; | 1 part of sprites; |
2 | 2 |
3 /// A texture represents a rectangular area of an image and is typically used to
draw a sprite to the screen. | 3 /// A texture represents a rectangular area of an image and is typically used to
draw a sprite to the screen. |
4 /// | 4 /// |
5 /// Normally you get a reference to a texture from a [SpriteSheet], but you can
also create one from an [Image]. | 5 /// Normally you get a reference to a texture from a [SpriteSheet], but you can
also create one from an [Image]. |
6 class Texture { | 6 class Texture { |
7 /// The image that this texture is a part of. | 7 /// The image that this texture is a part of. |
8 /// | 8 /// |
9 /// var textureImage = myTexture.image; | 9 /// var textureImage = myTexture.image; |
10 final Image image; | 10 final Image image; |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 Texture._fromSpriteFrame(this.image, this.name, this.size, this.rotated, this.
trimmed, this.frame, | 64 Texture._fromSpriteFrame(this.image, this.name, this.size, this.rotated, this.
trimmed, this.frame, |
65 this.spriteSourceSize, this.pivot) { | 65 this.spriteSourceSize, this.pivot) { |
66 } | 66 } |
67 | 67 |
68 // Texture textureFromRect(Rect rect, [String name = null]) { | 68 // Texture textureFromRect(Rect rect, [String name = null]) { |
69 // assert(rect != null); | 69 // assert(rect != null); |
70 // Rect frame = new Rect.fromLTRB(); | 70 // Rect frame = new Rect.fromLTRB(); |
71 // return new Texture._fromSpriteFrame(image, name, rect.size, false, false,
); | 71 // return new Texture._fromSpriteFrame(image, name, rect.size, false, false,
); |
72 // } | 72 // } |
73 } | 73 } |
OLD | NEW |