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

Unified Diff: sky/examples/game/main.dart

Issue 1187153002: Places demo game in a OneChildRenderObjectWrapper and adds a star field and nebula for background (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/game_demo_world.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/examples/game/main.dart
diff --git a/sky/examples/game/main.dart b/sky/examples/game/main.dart
index 7069b98da4d56fea9bddb9ab528146a131e600b5..4b5dc61d54b819b5c953208f5088017a63557bdf 100644
--- a/sky/examples/game/main.dart
+++ b/sky/examples/game/main.dart
@@ -1,7 +1,10 @@
import 'dart:sky';
import 'lib/game_demo.dart';
import 'lib/sprites.dart';
+import 'package:sky/widgets/basic.dart';
import 'package:sky/app/view.dart';
+import 'package:sky/widgets/ui_node.dart';
+import 'package:sky/widgets/raised_button.dart';
AppView app;
@@ -12,10 +15,47 @@ void main() {
"https://raw.githubusercontent.com/slembcke/GalacticGuardian.spritebuilder/GDC/Packages/SpriteBuilder%20Resources.sbpack/Sprites/resources-auto/asteroid_big_002.png",
"https://raw.githubusercontent.com/slembcke/GalacticGuardian.spritebuilder/GDC/Packages/SpriteBuilder%20Resources.sbpack/Sprites/resources-auto/GG_blueship_Lv3.png",
"https://raw.githubusercontent.com/slembcke/GalacticGuardian.spritebuilder/GDC/Packages/SpriteBuilder%20Resources.sbpack/Sprites/resources-auto/laserBlue.png",
+ "https://raw.githubusercontent.com/slembcke/GalacticGuardian.spritebuilder/GDC/Packages/SpriteBuilder%20Resources.sbpack/Sprites/resources-auto/laserFlashPurple.png",
+ "https://raw.githubusercontent.com/slembcke/GalacticGuardian.spritebuilder/GDC/Source/Resources/NebulaClouds.png",
],
allLoaded);
}
void allLoaded(ImageMap loader) {
- app = new AppView(root: (new GameDemoBox(new GameDemoWorld(loader))));
+ _loader = loader;
+ new GameDemoApp();
}
+
+class GameDemoApp extends App {
+
+ UINode build() {
+ return new Stack([
+ new GameDemo(),
+// new StackPositionedChild(
abarth-chromium 2015/06/16 17:37:01 StackPositionedChild -> Positioned
+// new Flex([
abarth-chromium 2015/06/16 17:37:01 child: new Flex([
+// new FlexExpandingChild(
abarth-chromium 2015/06/16 17:37:01 FlexExpandingChild -> Flexible
+// new RaisedButton(child:new Text("Hello")),
abarth-chromium 2015/06/16 17:37:01 child: new RaisedButton(child:new Text("Hello")),
+// key: 1
abarth-chromium 2015/06/16 17:37:01 key: 'hello'
+// ),
+// new FlexExpandingChild(
abarth-chromium 2015/06/16 17:37:01 FlexExpandingChild -> Flexible
+// new RaisedButton(child:new Text("Foo!")),
abarth-chromium 2015/06/16 17:37:01 child: new RaisedButton(child:new Text("Foo!")),
+// key: 2
abarth-chromium 2015/06/16 17:37:01 key: 'foo!'
+// )
+// ]),
+// right:0.0,
+// top: 20.0
+// )
+ ]);
+ }
+}
+
+ImageMap _loader;
+
+class GameDemo extends OneChildRenderObjectWrapper {
+
+ GameDemo({ UINode child, Object key })
+ : super(child: child, key: key);
+
+ GameDemoBox get root { return super.root; }
+ GameDemoBox createNode() => new GameDemoBox(new GameDemoWorld(_loader));
+}
« no previous file with comments | « sky/examples/game/lib/game_demo_world.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698