{"action":"created","comment":{"url":"https://api.github.com/repos/domokit/sky_engine/pulls/comments/35282758","id":35282758,"diff_hunk":"@@ -90,13 +91,77 @@ class GameDemoApp extends App {\n \n   Widget _buildMainScene(navigator, route) {\n     return new Center(\n-      child: new RaisedButton(\n-        child: new Text(\"Play\"),\n+      child: new TextureButton(\n         onPressed: () {\n           _game = new GameDemoWorld(_app, navigator, _loader, _spriteSheet, _spriteSheetUI);\n           navigator.pushNamed('/game');\n-        }\n+        },\n+        texture: _spriteSheetUI[\"btn_play_up.png\"],\n+        textureDown: _spriteSheetUI[\"btn_play_down.png\"],\n+        width: 128.0,\n+        height: 128.0\n       )\n     );\n   }\n }\n+\n+class TextureButton extends ButtonBase {\n+  TextureButton({\n+    Key key,\n+    this.onPressed,\n+    this.texture,\n+    this.textureDown,\n+    this.width: 128.0,\n+    this.height: 128.0\n+  }) : super(key: key);\n+\n+  Function onPressed;\n+  Texture texture;\n+  Texture textureDown;\n+  double width;\n+  double height;\n+  bool _pressed = false;\n+\n+  int _token = 0;\n+\n+  void syncFields(TextureButton source) {\n+    onPressed = source.onPressed;\n+    texture = source.texture;\n+    textureDown = source.textureDown;\n+    super.syncFields(source);\n+  }\n+\n+  Widget buildContent() {\n+    return new Listener(\n+      child: new Container(\n+        width: width,\n+        height: height,\n+        child: new CustomPaint(\n+          callback: paintCallback,\n+          token: _token\n+        )\n+      ),\n+      onGestureTap: (_) {\n+        if (onPressed != null) onPressed();\n+        _pressed = true;\n+        root.markNeedsPaint();\n+        _token++;","path":"sky/sdk/example/game/main.dart","position":72,"original_position":72,"commit_id":"7f4b2fc06b322d4da1a50982b8a0b6fe687ea12c","original_commit_id":"7f4b2fc06b322d4da1a50982b8a0b6fe687ea12c","user":{"login":"Hixie","id":551196,"avatar_url":"https://avatars.githubusercontent.com/u/551196?v=3","gravatar_id":"","url":"https://api.github.com/users/Hixie","html_url":"https://github.com/Hixie","followers_url":"https://api.github.com/users/Hixie/followers","following_url":"https://api.github.com/users/Hixie/following{/other_user}","gists_url":"https://api.github.com/users/Hixie/gists{/gist_id}","starred_url":"https://api.github.com/users/Hixie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Hixie/subscriptions","organizations_url":"https://api.github.com/users/Hixie/orgs","repos_url":"https://api.github.com/users/Hixie/repos","events_url":"https://api.github.com/users/Hixie/events{/privacy}","received_events_url":"https://api.github.com/users/Hixie/received_events","type":"User","site_admin":false},"body":"You should change the _token inside a setState() method call, otherwise it won't notify that the state changed, update the token, etc.","created_at":"2015-07-23T01:21:57Z","updated_at":"2015-07-23T01:21:57Z","html_url":"https://github.com/domokit/sky_engine/pull/223#discussion_r35282758","pull_request_url":"https://api.github.com/repos/domokit/sky_engine/pulls/223","_links":{"self":{"href":"https://api.github.com/repos/domokit/sky_engine/pulls/comments/35282758"},"html":{"href":"https://github.com/domokit/sky_engine/pull/223#discussion_r35282758"},"pull_request":{"href":"https://api.github.com/repos/domokit/sky_engine/pulls/223"}}},"pull_request":{"url":"https://api.github.com/repos/domokit/sky_engine/pulls/223","id":40624765,"html_url":"https://github.com/domokit/sky_engine/pull/223","diff_url":"https://github.com/domokit/sky_engine/pull/223.diff","patch_url":"https://github.com/domokit/sky_engine/pull/223.patch","issue_url":"https://api.github.com/repos/domokit/sky_engine/issues/223","number":223,"state":"open","locked":false,"title":"Adds custom play button with texture to demo game","user":{"login":"vlidholt","id":1539812,"avatar_url":"https://avatars.githubusercontent.com/u/1539812?v=3","gravatar_id":"","url":"https://api.github.com/users/vlidholt","html_url":"https://github.com/vlidholt","followers_url":"https://api.github.com/users/vlidholt/followers","following_url":"https://api.github.com/users/vlidholt/following{/other_user}","gists_url":"https://api.github.com/users/vlidholt/gists{/gist_id}","starred_url":"https://api.github.com/users/vlidholt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vlidholt/subscriptions","organizations_url":"https://api.github.com/users/vlidholt/orgs","repos_url":"https://api.github.com/users/vlidholt/repos","events_url":"https://api.github.com/users/vlidholt/events{/privacy}","received_events_url":"https://api.github.com/users/vlidholt/received_events","type":"User","site_admin":false},"body":"Custom play button drawn with a Texture, up and down state.","created_at":"2015-07-22T23:54:41Z","updated_at":"2015-07-23T01:21:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"00c28fa8bc0e8372843844f1f3fcac901f6eebfb","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/domokit/sky_engine/pulls/223/commits","review_comments_url":"https://api.github.com/repos/domokit/sky_engine/pulls/223/comments","review_comment_url":"https://api.github.com/repos/domokit/sky_engine/pulls/comments{/number}","comments_url":"https://api.github.com/repos/domokit/sky_engine/issues/223/comments","statuses_url":"https://api.github.com/repos/domokit/sky_engine/statuses/7f4b2fc06b322d4da1a50982b8a0b6fe687ea12c","head":{"label":"vlidholt:master","ref":"master","sha":"7f4b2fc06b322d4da1a50982b8a0b6fe687ea12c","user":{"login":"vlidholt","id":1539812,"avatar_url":"https://avatars.githubusercontent.com/u/1539812?v=3","gravatar_id":"","url":"https://api.github.com/users/vlidholt","html_url":"https://github.com/vlidholt","followers_url":"https://api.github.com/users/vlidholt/followers","following_url":"https://api.github.com/users/vlidholt/following{/other_user}","gists_url":"https://api.github.com/users/vlidholt/gists{/gist_id}","starred_url":"https://api.github.com/users/vlidholt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vlidholt/subscriptions","organizations_url":"https://api.github.com/users/vlidholt/orgs","repos_url":"https://api.github.com/users/vlidholt/repos","events_url":"https://api.github.com/users/vlidholt/events{/privacy}","received_events_url":"https://api.github.com/users/vlidholt/received_events","type":"User","site_admin":false},"repo":{"id":39393886,"name":"sky_engine","full_name":"vlidholt/sky_engine","owner":{"login":"vlidholt","id":1539812,"avatar_url":"https://avatars.githubusercontent.com/u/1539812?v=3","gravatar_id":"","url":"https://api.github.com/users/vlidholt","html_url":"https://github.com/vlidholt","followers_url":"https://api.github.com/users/vlidholt/followers","following_url":"https://api.github.com/users/vlidholt/following{/other_user}","gists_url":"https://api.github.com/users/vlidholt/gists{/gist_id}","starred_url":"https://api.github.com/users/vlidholt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vlidholt/subscriptions","organizations_url":"https://api.github.com/users/vlidholt/orgs","repos_url":"https://api.github.com/users/vlidholt/repos","events_url":"https://api.github.com/users/vlidholt/events{/privacy}","received_events_url":"https://api.github.com/users/vlidholt/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/vlidholt/sky_engine","description":"The Sky engine","fork":true,"url":"https://api.github.com/repos/vlidholt/sky_engine","forks_url":"https://api.github.com/repos/vlidholt/sky_engine/forks","keys_url":"https://api.github.com/repos/vlidholt/sky_engine/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vlidholt/sky_engine/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vlidholt/sky_engine/teams","hooks_url":"https://api.github.com/repos/vlidholt/sky_engine/hooks","issue_events_url":"https://api.github.com/repos/vlidholt/sky_engine/issues/events{/number}","events_url":"https://api.github.com/repos/vlidholt/sky_engine/events","assignees_url":"https://api.github.com/repos/vlidholt/sky_engine/assignees{/user}","branches_url":"https://api.github.com/repos/vlidholt/sky_engine/branches{/branch}","tags_url":"https://api.github.com/repos/vlidholt/sky_engine/tags","blobs_url":"https://api.github.com/repos/vlidholt/sky_engine/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vlidholt/sky_engine/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vlidholt/sky_engine/git/refs{/sha}","trees_url":"https://api.github.com/repos/vlidholt/sky_engine/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vlidholt/sky_engine/statuses/{sha}","languages_url":"https://api.github.com/repos/vlidholt/sky_engine/languages","stargazers_url":"https://api.github.com/repos/vlidholt/sky_engine/stargazers","contributors_url":"https://api.github.com/repos/vlidholt/sky_engine/contributors","subscribers_url":"https://api.github.com/repos/vlidholt/sky_engine/subscribers","subscription_url":"https://api.github.com/repos/vlidholt/sky_engine/subscription","commits_url":"https://api.github.com/repos/vlidholt/sky_engine/commits{/sha}","git_commits_url":"https://api.github.com/repos/vlidholt/sky_engine/git/commits{/sha}","comments_url":"https://api.github.com/repos/vlidholt/sky_engine/comments{/number}","issue_comment_url":"https://api.github.com/repos/vlidholt/sky_engine/issues/comments{/number}","contents_url":"https://api.github.com/repos/vlidholt/sky_engine/contents/{+path}","compare_url":"https://api.github.com/repos/vlidholt/sky_engine/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vlidholt/sky_engine/merges","archive_url":"https://api.github.com/repos/vlidholt/sky_engine/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vlidholt/sky_engine/downloads","issues_url":"https://api.github.com/repos/vlidholt/sky_engine/issues{/number}","pulls_url":"https://api.github.com/repos/vlidholt/sky_engine/pulls{/number}","milestones_url":"https://api.github.com/repos/vlidholt/sky_engine/milestones{/number}","notifications_url":"https://api.github.com/repos/vlidholt/sky_engine/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vlidholt/sky_engine/labels{/name}","releases_url":"https://api.github.com/repos/vlidholt/sky_engine/releases{/id}","created_at":"2015-07-20T16:02:35Z","updated_at":"2015-07-20T16:02:54Z","pushed_at":"2015-07-22T23:52:28Z","git_url":"git://github.com/vlidholt/sky_engine.git","ssh_url":"git@github.com:vlidholt/sky_engine.git","clone_url":"https://github.com/vlidholt/sky_engine.git","svn_url":"https://github.com/vlidholt/sky_engine","homepage":null,"size":71033,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"domokit:master","ref":"master","sha":"626638946213248f81c998706f6402d6349490b9","user":{"login":"domokit","id":8664152,"avatar_url":"https://avatars.githubusercontent.com/u/8664152?v=3","gravatar_id":"","url":"https://api.github.com/users/domokit","html_url":"https://github.com/domokit","followers_url":"https://api.github.com/users/domokit/followers","following_url":"https://api.github.com/users/domokit/following{/other_user}","gists_url":"https://api.github.com/users/domokit/gists{/gist_id}","starred_url":"https://api.github.com/users/domokit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/domokit/subscriptions","organizations_url":"https://api.github.com/users/domokit/orgs","repos_url":"https://api.github.com/users/domokit/repos","events_url":"https://api.github.com/users/domokit/events{/privacy}","received_events_url":"https://api.github.com/users/domokit/received_events","type":"Organization","site_admin":false},"repo":{"id":39211337,"name":"sky_engine","full_name":"domokit/sky_engine","owner":{"login":"domokit","id":8664152,"avatar_url":"https://avatars.githubusercontent.com/u/8664152?v=3","gravatar_id":"","url":"https://api.github.com/users/domokit","html_url":"https://github.com/domokit","followers_url":"https://api.github.com/users/domokit/followers","following_url":"https://api.github.com/users/domokit/following{/other_user}","gists_url":"https://api.github.com/users/domokit/gists{/gist_id}","starred_url":"https://api.github.com/users/domokit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/domokit/subscriptions","organizations_url":"https://api.github.com/users/domokit/orgs","repos_url":"https://api.github.com/users/domokit/repos","events_url":"https://api.github.com/users/domokit/events{/privacy}","received_events_url":"https://api.github.com/users/domokit/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/domokit/sky_engine","description":"The Sky engine","fork":false,"url":"https://api.github.com/repos/domokit/sky_engine","forks_url":"https://api.github.com/repos/domokit/sky_engine/forks","keys_url":"https://api.github.com/repos/domokit/sky_engine/keys{/key_id}","collaborators_url":"https://api.github.com/repos/domokit/sky_engine/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/domokit/sky_engine/teams","hooks_url":"https://api.github.com/repos/domokit/sky_engine/hooks","issue_events_url":"https://api.github.com/repos/domokit/sky_engine/issues/events{/number}","events_url":"https://api.github.com/repos/domokit/sky_engine/events","assignees_url":"https://api.github.com/repos/domokit/sky_engine/assignees{/user}","branches_url":"https://api.github.com/repos/domokit/sky_engine/branches{/branch}","tags_url":"https://api.github.com/repos/domokit/sky_engine/tags","blobs_url":"https://api.github.com/repos/domokit/sky_engine/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/domokit/sky_engine/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/domokit/sky_engine/git/refs{/sha}","trees_url":"https://api.github.com/repos/domokit/sky_engine/git/trees{/sha}","statuses_url":"https://api.github.com/repos/domokit/sky_engine/statuses/{sha}","languages_url":"https://api.github.com/repos/domokit/sky_engine/languages","stargazers_url":"https://api.github.com/repos/domokit/sky_engine/stargazers","contributors_url":"https://api.github.com/repos/domokit/sky_engine/contributors","subscribers_url":"https://api.github.com/repos/domokit/sky_engine/subscribers","subscription_url":"https://api.github.com/repos/domokit/sky_engine/subscription","commits_url":"https://api.github.com/repos/domokit/sky_engine/commits{/sha}","git_commits_url":"https://api.github.com/repos/domokit/sky_engine/git/commits{/sha}","comments_url":"https://api.github.com/repos/domokit/sky_engine/comments{/number}","issue_comment_url":"https://api.github.com/repos/domokit/sky_engine/issues/comments{/number}","contents_url":"https://api.github.com/repos/domokit/sky_engine/contents/{+path}","compare_url":"https://api.github.com/repos/domokit/sky_engine/compare/{base}...{head}","merges_url":"https://api.github.com/repos/domokit/sky_engine/merges","archive_url":"https://api.github.com/repos/domokit/sky_engine/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/domokit/sky_engine/downloads","issues_url":"https://api.github.com/repos/domokit/sky_engine/issues{/number}","pulls_url":"https://api.github.com/repos/domokit/sky_engine/pulls{/number}","milestones_url":"https://api.github.com/repos/domokit/sky_engine/milestones{/number}","notifications_url":"https://api.github.com/repos/domokit/sky_engine/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/domokit/sky_engine/labels{/name}","releases_url":"https://api.github.com/repos/domokit/sky_engine/releases{/id}","created_at":"2015-07-16T17:39:56Z","updated_at":"2015-07-22T21:29:28Z","pushed_at":"2015-07-23T01:16:10Z","git_url":"git://github.com/domokit/sky_engine.git","ssh_url":"git@github.com:domokit/sky_engine.git","clone_url":"https://github.com/domokit/sky_engine.git","svn_url":"https://github.com/domokit/sky_engine","homepage":null,"size":72652,"stargazers_count":39,"watchers_count":39,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":16,"mirror_url":null,"open_issues_count":109,"forks":16,"open_issues":109,"watchers":39,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/domokit/sky_engine/pulls/223"},"html":{"href":"https://github.com/domokit/sky_engine/pull/223"},"issue":{"href":"https://api.github.com/repos/domokit/sky_engine/issues/223"},"comments":{"href":"https://api.github.com/repos/domokit/sky_engine/issues/223/comments"},"review_comments":{"href":"https://api.github.com/repos/domokit/sky_engine/pulls/223/comments"},"review_comment":{"href":"https://api.github.com/repos/domokit/sky_engine/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/domokit/sky_engine/pulls/223/commits"},"statuses":{"href":"https://api.github.com/repos/domokit/sky_engine/statuses/7f4b2fc06b322d4da1a50982b8a0b6fe687ea12c"}}}}