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

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: 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 Size _size;
jackson 2015/06/23 22:09:43 You might want to make this public and final inste
6 String _fileName;
jackson 2015/06/23 22:09:43 Ditto
7 bool _rotated;
jackson 2015/06/23 22:09:43 final?
8 bool _trimmed;
jackson 2015/06/23 22:09:43 final?
9
10 Rect _frame;
jackson 2015/06/23 22:09:43 Ditto
11 Rect _spriteSourceSize;
jackson 2015/06/23 22:09:43 Ditto
12
13 Point _pivot;
jackson 2015/06/23 22:09:43 final?
14
15 Texture(this.image) {
16 _size = new Size(image.width.toDouble(), image.height.toDouble());
jackson 2015/06/23 22:09:43 Usually it's good to initialize members after the
17 _trimmed = false;
18 _rotated = false;
19 _frame = new Rect.fromLTRB(0.0, 0.0, _size.width, _size.height);
20 _spriteSourceSize = new Rect.fromLTRB(0.0, 0.0, _size.width, _size.height);
21 _pivot = new Point(0.5, 0.5);
22 }
23
24 Texture._fromSpriteFrame(this.image, this._fileName, this._size, this._rotated , this._trimmed, this._frame,
25 this._spriteSourceSize, this._pivot) {
26 }
27
28 Size get size => _size;
29
30 String get fileName => _fileName;
31
32 Rect get frame => _frame;
33
34 Rect get spriteSourceSize => _spriteSourceSize;
35
36 Texture textureFromRect(Rect rect, Point offset, bool rotated) {
37 // TODO: Implement this
38 return null;
39 }
40 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698