Chromium Code Reviews| 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)); |
| +} |