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

Unified Diff: samples/third_party/pop-pop-win/lib/src/canvas/new_game_element.dart

Issue 200723008: samples/poppopwin: upgrade to first-class sample (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: fixed pkgbuild.status for rename Created 6 years, 9 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: samples/third_party/pop-pop-win/lib/src/canvas/new_game_element.dart
diff --git a/samples/third_party/pop-pop-win/lib/src/canvas/new_game_element.dart b/samples/third_party/pop-pop-win/lib/src/canvas/new_game_element.dart
deleted file mode 100644
index 431556d38c9dcd64c7d2d48e1145dc43e8e5848e..0000000000000000000000000000000000000000
--- a/samples/third_party/pop-pop-win/lib/src/canvas/new_game_element.dart
+++ /dev/null
@@ -1,31 +0,0 @@
-part of ppw_canvas;
-
-class NewGameElement extends Thing {
- final EventHandle<EventArgs> _clickedEvent =
- new EventHandle<EventArgs>();
-
- NewGameElement() : super(294, 92) {
- MouseManager.setClickable(this, true);
- MouseManager.getClickStream(this).listen((args) =>
- _clickedEvent.add(EventArgs.empty));
- Mouse.isMouseDirectlyOverProperty.getStream(this).listen(_mouseDirectlyOver);
- }
-
- Stream<EventArgs> get clicked => _clickedEvent.stream;
-
- void drawOverride(CanvasRenderingContext2D ctx) {
- final texture = Mouse.isMouseDirectlyOver(this) ?
- 'button_new_game_clicked.png' : 'button_new_game.png';
- _textureData.drawTextureKeyAt(ctx, texture);
- }
-
- GameElement get _gameElement => (parent as CanvasThing).parent;
-
- TextureData get _textureData => _gameElement._textureData;
-
- Game get _game => _gameElement._game;
-
- void _mouseDirectlyOver(args) {
- invalidateDraw();
- }
-}

Powered by Google App Engine
This is Rietveld 408576698