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

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

Issue 1217933002: Rename RenderCanvas to PaintingCanvas to avoid confusion with other classes that inherit from Rende… (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/sprite.dart ('k') | sky/sdk/example/rendering/sector_layout.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 /// Options for setting up a [SpriteBox]. 3 /// Options for setting up a [SpriteBox].
4 /// 4 ///
5 /// * [nativePoints], use the same points as the parent [Widget]. 5 /// * [nativePoints], use the same points as the parent [Widget].
6 /// * [letterbox], use the size of the root node for the coordinate system, con strain the aspect ratio and trim off 6 /// * [letterbox], use the size of the root node for the coordinate system, con strain the aspect ratio and trim off
7 /// areas that end up outside the screen. 7 /// areas that end up outside the screen.
8 /// * [stretch], use the size of the root node for the coordinate system, scale it to fit the size of the box. 8 /// * [stretch], use the size of the root node for the coordinate system, scale it to fit the size of the box.
9 /// * [scaleToFit], similar to the letterbox option, but instead of trimming ar eas the sprite system will be scaled 9 /// * [scaleToFit], similar to the letterbox option, but instead of trimming ar eas the sprite system will be scaled
10 /// down to fit the box. 10 /// down to fit the box.
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 _transformMatrix.scale(scaleX, scaleY); 244 _transformMatrix.scale(scaleX, scaleY);
245 245
246 return _transformMatrix; 246 return _transformMatrix;
247 } 247 }
248 248
249 void _invalidateTransformMatrix() { 249 void _invalidateTransformMatrix() {
250 _transformMatrix = null; 250 _transformMatrix = null;
251 _rootNode._invalidateToBoxTransformMatrix(); 251 _rootNode._invalidateToBoxTransformMatrix();
252 } 252 }
253 253
254 void paint(RenderCanvas canvas, Offset offset) { 254 void paint(PaintingCanvas canvas, Offset offset) {
255 canvas.save(); 255 canvas.save();
256 256
257 // Move to correct coordinate space before drawing 257 // Move to correct coordinate space before drawing
258 canvas.translate(offset.dx, offset.dy); 258 canvas.translate(offset.dx, offset.dy);
259 canvas.concat(transformMatrix.storage); 259 canvas.concat(transformMatrix.storage);
260 260
261 // Draw the sprite tree 261 // Draw the sprite tree
262 _rootNode._visit(canvas); 262 _rootNode._visit(canvas);
263 263
264 canvas.restore(); 264 canvas.restore();
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 /// if (event.pointer == firstPointerId) { 373 /// if (event.pointer == firstPointerId) {
374 /// // Do something 374 /// // Do something
375 /// } 375 /// }
376 final int pointer; 376 final int pointer;
377 377
378 /// Creates a new SpriteBoxEvent, typically this is done internally inside the SpriteBox. 378 /// Creates a new SpriteBoxEvent, typically this is done internally inside the SpriteBox.
379 /// 379 ///
380 /// var event = new SpriteBoxEvent(new Point(50.0, 50.0), 'pointerdown', 0 ); 380 /// var event = new SpriteBoxEvent(new Point(50.0, 50.0), 'pointerdown', 0 );
381 SpriteBoxEvent(this.boxPosition, this.type, this.pointer); 381 SpriteBoxEvent(this.boxPosition, this.type, this.pointer);
382 } 382 }
OLDNEW
« no previous file with comments | « sky/sdk/example/game/lib/sprite.dart ('k') | sky/sdk/example/rendering/sector_layout.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698