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

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

Issue 1218593002: Move sky/examples to sky/sdk/lib/example, and code changes to support that change. Fixes T277. (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
Index: sky/examples/game/main.dart
diff --git a/sky/examples/game/main.dart b/sky/examples/game/main.dart
deleted file mode 100644
index 15fb88e61f260d68430cb7772a5983924c2c4bfc..0000000000000000000000000000000000000000
--- a/sky/examples/game/main.dart
+++ /dev/null
@@ -1,58 +0,0 @@
-import 'dart:sky';
-
-import 'package:sky/widgets/basic.dart';
-import 'package:sky/widgets/raised_button.dart';
-import 'package:sky/widgets/widget.dart';
-import 'package:sky/framework/net/fetch.dart';
-
-import 'lib/game_demo.dart';
-import 'lib/sprites.dart';
-
-void main() {
- // Load images
- new ImageMap([
- "res/nebula.png",
- "res/sprites.png",
- ],
- allImagesLoaded);
-}
-
-void allImagesLoaded(ImageMap loader) {
- _loader = loader;
-
- fetchBody("res/sprites.json").then((Response response) {
- String json = response.bodyAsString();
- _spriteSheet = new SpriteSheet(_loader["res/sprites.png"], json);
- allResourcesLoaded();
- });
-}
-
-void allResourcesLoaded() {
- runApp(new GameDemoApp());
-}
-
-class GameDemoApp extends App {
-
- Widget build() {
- return new Stack([
- new SpriteWidget(new GameDemoWorld(_loader, _spriteSheet)),
-// new StackPositionedChild(
-// new Flex([
-// new FlexExpandingChild(
-// new RaisedButton(child:new Text("Hello")),
-// key: 1
-// ),
-// new FlexExpandingChild(
-// new RaisedButton(child:new Text("Foo!")),
-// key: 2
-// )
-// ]),
-// right:0.0,
-// top: 20.0
-// )
- ]);
- }
-}
-
-ImageMap _loader;
-SpriteSheet _spriteSheet;

Powered by Google App Engine
This is Rietveld 408576698