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

Side by Side Diff: sky/examples/game/main.dart

Issue 1161023006: Adds basic support for images in game example (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: git cl status 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
« no previous file with comments | « sky/examples/game/lib/sprites.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 import 'dart:sky'; 1 import 'dart:sky';
2 import 'lib/game.dart'; 2 import 'lib/game.dart';
3 import 'lib/sprites.dart'; 3 import 'lib/sprites.dart';
4 import 'package:sky/framework/app.dart'; 4 import 'package:sky/framework/app.dart';
5 5
6 AppView app; 6 AppView app;
7 7
8 void main() { 8 void main() {
9 // Load images
10 new ImageMap([
11 "https://raw.githubusercontent.com/slembcke/GalacticGuardian.spritebuilder /GDC/Packages/SpriteBuilder%20Resources.sbpack/resources-auto/BurnTexture.png",
12 "https://raw.githubusercontent.com/slembcke/GalacticGuardian.spritebuilder /GDC/Packages/SpriteBuilder%20Resources.sbpack/Sprites/resources-auto/asteroid_b ig_002.png",
13 ],
14 allLoaded);
15 }
16
17 void allLoaded(ImageMap loader) {
9 // Create a new app with the sprite box that contains our game world 18 // Create a new app with the sprite box that contains our game world
10 app = new AppView(new SpriteBox(new GameWorld(1024.0, 1024.0),SpriteBoxTransfo rmMode.letterbox)); 19 app = new AppView(new SpriteBox(new GameWorld(loader),SpriteBoxTransformMode.l etterbox));
11 } 20 }
OLDNEW
« no previous file with comments | « sky/examples/game/lib/sprites.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698