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

Unified Diff: sky/examples/game/lib/sprite_widget.dart

Issue 1197493002: Adds a SpriteWidget and simplifies sample game setup (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/examples/game/lib/sprite_box.dart ('k') | sky/examples/game/lib/sprites.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/examples/game/lib/sprite_widget.dart
diff --git a/sky/examples/game/lib/sprite_widget.dart b/sky/examples/game/lib/sprite_widget.dart
new file mode 100644
index 0000000000000000000000000000000000000000..b2737bc9d5ed2ef1be35f89c7d77deb6a47ab794
--- /dev/null
+++ b/sky/examples/game/lib/sprite_widget.dart
@@ -0,0 +1,15 @@
+part of sprites;
+
+class SpriteWidget extends OneChildRenderObjectWrapper {
+
+ NodeWithSize _rootNode;
+ SpriteBoxTransformMode _transformMode;
+
+ SpriteWidget(NodeWithSize this._rootNode, [SpriteBoxTransformMode this._transformMode = SpriteBoxTransformMode.letterbox]);
abarth-chromium 2015/06/19 00:18:06 You can remove the "NodeWithSize" annotation. The
+
+ SpriteBox get root { return super.root; }
abarth-chromium 2015/06/19 00:18:06 SpriteBox get root => super.root;
+
+ SpriteBox createNode() => new SpriteBox(_rootNode, _transformMode);
+
+ NodeWithSize get rootNode => _rootNode;
abarth-chromium 2015/06/19 00:18:06 You need to implement syncRenderObject. Take a lo
+}
« no previous file with comments | « sky/examples/game/lib/sprite_box.dart ('k') | sky/examples/game/lib/sprites.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698