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

Side by Side Diff: sky/sdk/example/game/lib/spritesheet.dart

Issue 1210173004: Move examples to //sky/sdk/example (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 5 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/sdk/example/game/lib/sprites.dart ('k') | sky/sdk/example/game/lib/texture.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 part of sprites; 1 part of sprites;
2 2
3 /// A sprite sheet packs a number of smaller images into a single large image. 3 /// A sprite sheet packs a number of smaller images into a single large image.
4 /// 4 ///
5 /// The placement of the smaller images are defined by a json file. The larger i mage and json file is typically created 5 /// The placement of the smaller images are defined by a json file. The larger i mage and json file is typically created
6 /// by a tool such as TexturePacker. The [SpriteSheet] class will take a referen ce to a larger image and a json string. 6 /// by a tool such as TexturePacker. The [SpriteSheet] class will take a referen ce to a larger image and a json string.
7 /// From the image and the string the [SpriteSheet] creates a number of [Texture ] objects. The names of the frames in 7 /// From the image and the string the [SpriteSheet] creates a number of [Texture ] objects. The names of the frames in
8 /// the sprite sheet definition are used to reference the different textures. 8 /// the sprite sheet definition are used to reference the different textures.
9 class SpriteSheet { 9 class SpriteSheet {
10 10
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 /// The image used by the sprite sheet. 65 /// The image used by the sprite sheet.
66 /// 66 ///
67 /// var spriteSheetImage = mySpriteSheet.image; 67 /// var spriteSheetImage = mySpriteSheet.image;
68 Image get image => _image; 68 Image get image => _image;
69 69
70 /// Returns a texture by its name. 70 /// Returns a texture by its name.
71 /// 71 ///
72 /// var myTexture = mySpriteSheet["example.png"]; 72 /// var myTexture = mySpriteSheet["example.png"];
73 Texture operator [](String fileName) => _textures[fileName]; 73 Texture operator [](String fileName) => _textures[fileName];
74 } 74 }
OLDNEW
« no previous file with comments | « sky/sdk/example/game/lib/sprites.dart ('k') | sky/sdk/example/game/lib/texture.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698