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

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

Issue 1215413002: First pass on action animations for sprites (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
OLDNEW
1 part of sprites; 1 part of sprites;
2 2
3 double convertDegrees2Radians(double degrees) => degrees * Math.PI/180.8; 3 double convertDegrees2Radians(double degrees) => degrees * Math.PI/180.8;
4 4
5 double convertRadians2Degrees(double radians) => radians * 180.0/Math.PI; 5 double convertRadians2Degrees(double radians) => radians * 180.0/Math.PI;
6 6
7 /// A base class for all objects that can be added to the sprite node tree and r endered to screen using [SpriteBox] and 7 /// A base class for all objects that can be added to the sprite node tree and r endered to screen using [SpriteBox] and
8 /// [SpriteWidget]. 8 /// [SpriteWidget].
9 /// 9 ///
10 /// The [Node] class itself doesn't render any content, but provides the basic f unctions of any type of node, such as 10 /// The [Node] class itself doesn't render any content, but provides the basic f unctions of any type of node, such as
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 /// This property is only meaningful if [userInteractionEnabled] is set to tru e. Default value is false. 52 /// This property is only meaningful if [userInteractionEnabled] is set to tru e. Default value is false.
53 /// 53 ///
54 /// class MyCustomNode extends Node { 54 /// class MyCustomNode extends Node {
55 /// handleMultiplePointers = true; 55 /// handleMultiplePointers = true;
56 /// } 56 /// }
57 bool handleMultiplePointers = false; 57 bool handleMultiplePointers = false;
58 int _handlingPointer; 58 int _handlingPointer;
59 59
60 List<Node>_children = []; 60 List<Node>_children = [];
61 61
62 ActionController _actions;
63
64 ActionController get actions {
65 if (_actions == null) {
66 _actions = new ActionController();
67 }
68 return _actions;
69 }
70
62 // Constructors 71 // Constructors
63 72
64 /// Creates a new [Node] without any transformation. 73 /// Creates a new [Node] without any transformation.
65 /// 74 ///
66 /// var myNode = new Node(); 75 /// var myNode = new Node();
67 Node() { 76 Node() {
68 } 77 }
69 78
70 // Property setters and getters 79 // Property setters and getters
71 80
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after
521 /// else if (event.type == 'pointerup') { 530 /// else if (event.type == 'pointerup') {
522 /// opacity = 1.0; 531 /// opacity = 1.0;
523 /// } 532 /// }
524 /// return true; 533 /// return true;
525 /// } 534 /// }
526 /// } 535 /// }
527 bool handleEvent(SpriteBoxEvent event) { 536 bool handleEvent(SpriteBoxEvent event) {
528 return false; 537 return false;
529 } 538 }
530 } 539 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698