Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(372)

Side by Side Diff: sky/examples/game/lib/texture.dart

Issue 1204783003: Adds basic sprite sheet support to sprites (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Adds basic sprite sheet support to sprites (fixed issues) Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 part of sprites;
2
3 class Texture {
4 final Image image;
5 final Size size;
6 String name;
7 final bool rotated;
8 final bool trimmed;
9
10 Rect frame;
11 Rect spriteSourceSize;
12
13 Point pivot;
14
15 Texture(Image image) :
16 size = new Size(image.width.toDouble(), image.height.toDouble()),
17 image = image,
18 trimmed = false,
19 rotated = false,
20 frame = new Rect.fromLTRB(0.0, 0.0, image.width.toDouble(), image.height.toD ouble()),
eseidel 2015/06/23 23:22:31 fromPointAndSize ? I guess Image doesn't have a s
21 spriteSourceSize = new Rect.fromLTRB(0.0, 0.0, image.width.toDouble(), image .height.toDouble()),
22 pivot = new Point(0.5, 0.5);
23
24
25 Texture._fromSpriteFrame(this.image, this.name, this.size, this.rotated, this. trimmed, this.frame,
26 this.spriteSourceSize, this.pivot) {
27 }
28
29 Texture textureFromRect(Rect rect, Point offset, bool rotated) {
30 // TODO: Implement this
31 return null;
32 }
33 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698