Title: `TransitionTimeMs` is not inherited from one callback invocation to the next · Issue #76 · PAIR-code/megaplot · GitHub
Open Graph Title: `TransitionTimeMs` is not inherited from one callback invocation to the next · Issue #76 · PAIR-code/megaplot
X Title: `TransitionTimeMs` is not inherited from one callback invocation to the next · Issue #76 · PAIR-code/megaplot
Description: Inside of a Sprite callback, the API user can set TransitionTimeMs to specify how long the transition should take to complete. However, unlike other sprite attributes, TransitionTimeMs is not inherited from the previous phase and must be...
Open Graph Description: Inside of a Sprite callback, the API user can set TransitionTimeMs to specify how long the transition should take to complete. However, unlike other sprite attributes, TransitionTimeMs is not inher...
X Description: Inside of a Sprite callback, the API user can set TransitionTimeMs to specify how long the transition should take to complete. However, unlike other sprite attributes, TransitionTimeMs is not inher...
Opengraph URL: https://github.com/PAIR-code/megaplot/issues/76
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`TransitionTimeMs` is not inherited from one callback invocation to the next","articleBody":"Inside of a Sprite callback, the API user can set `TransitionTimeMs` to specify how long the transition should take to complete. However, unlike other sprite attributes, `TransitionTimeMs` is not inherited from the previous phase and must be set in each phase callback.\r\n\r\nExample using `Sprite` API (see comments):\r\n\r\n```ts\r\nconst scene = new Scene({\r\n defaultTransitionTimeMs: 400, // Default transition time is 400.\r\n});\r\n\r\nconst sprite = scene.createSprite();\r\n\r\nsprite\r\n .enter((s: SpriteView) =\u003e {\r\n s.TransitionTimeMs = 1000; // Explicitly set time to 1000 (1 sec).\r\n s.SizeWorld = 1;\r\n s.FillOpacity = 0;\r\n })\r\n .update((s: SpriteView) =\u003e {\r\n // CURRENTLY: s.TransitionTimeMs implicitly set to the default (400).\r\n // DESIRED: s.TransitionTimeMs should persist the 1000 from enter().\r\n\r\n // s.SizeWorld is correctly inherited from previous state (1).\r\n\r\n s.FillOpacity = 1;\r\n });\r\n```\r\n\r\nExample using the `Selection` API (see comments):\r\n\r\n```ts\r\nconst scene = new Scene({\r\n defaultTransitionTimeMs: 500, // Default transition time is 500.\r\n});\r\n\r\nconst selection = scene.createSelection();\r\n\r\nselection\r\n .onInit((s: SpriteView) =\u003e {\r\n // CURRENTLY: Ignored for rendering and not persisted.\r\n // DESIRED: Still ignore for rendering, but persist value.\r\n s.TransitionTimeMs = 1000; \r\n\r\n s.SizeWorld = 1;\r\n s.FillOpacity = 0;\r\n })\r\n .onEnter((s: SpriteView) =\u003e {\r\n // CURRENTLY: s.TransitionTimeMs implicitly set to the default (500).\r\n // DESIRED: s.TransitionTimeMs should persist 1000 from onInit().\r\n\r\n s.TransitionTimeMs = 2000; // Explicitly set to 2000.\r\n\r\n // s.SizeWorld is inherited from previous state (1).\r\n s.FillOpacity = 1;\r\n })\r\n .onUpdate((s: SpriteView) =\u003e {\r\n // CURRENTLY: s.TransitionTimeMs implicitly set to the default (500).\r\n // DESIRED: s.TransitionTimeMs should persist 2000 from onEnter().\r\n\r\n // s.SizeWorld is inherited from previous state (1).\r\n s.FillOpacity = 1;\r\n });\r\n```\r\n\r\nIdeally, `TransitionTimeMs` should persist between callback invocations. The Scene's `defaultTransitionTimeMs` should only be used until the first time a transition time is needed, and then after that the previous value should be used again. This would make it consistent with other sprite attributes.\r\n\r\nNote: The fact that the transition time is ignored for Selection `onInit()` is intentional. The attributes set for `onInit()` should be applied before the first frame in which the Sprite is rendered. However, the `TransitionTimeMs` set during `onInit()` should be used for callback invocations. Ignoring this value and not persisting it is counterintuitive.","author":{"url":"https://github.com/jimbojw","@type":"Person","name":"jimbojw"},"datePublished":"2022-10-11T12:32:57.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/76/megaplot/issues/76"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:a28de528-63ff-58b5-4078-ffc8220a09ee |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A5BC:10ED6:98EF36:D0A1FF:6A4DDDC1 |
| html-safe-nonce | 50be3f45a8365e2df5ac5314c8cd849eededd1328e96cd232c813e8ca24abc2e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNUJDOjEwRUQ2Ojk4RUYzNjpEMEExRkY6NkE0REREQzEiLCJ2aXNpdG9yX2lkIjoiNDUxNTM4NzU5NjM5NDU4NTUzNyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 3de79c9b46f9ab9323d6a96298bb389753e8585901b65334527ab53b77acfd22 |
| hovercard-subject-tag | issue:1404562333 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/PAIR-code/megaplot/76/issue_layout |
| twitter:image | https://opengraph.githubassets.com/04fac5ebf35b9894c3972c7557dbfc6ee7c7053f3a6e1e8260cd22f9bfe1b20b/PAIR-code/megaplot/issues/76 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/04fac5ebf35b9894c3972c7557dbfc6ee7c7053f3a6e1e8260cd22f9bfe1b20b/PAIR-code/megaplot/issues/76 |
| og:image:alt | Inside of a Sprite callback, the API user can set TransitionTimeMs to specify how long the transition should take to complete. However, unlike other sprite attributes, TransitionTimeMs is not inher... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jimbojw |
| hostname | github.com |
| expected-hostname | github.com |
| None | 06b8a6144231bf3a234f1c2e9993861e07ce98a905912b114aa386c2d7e84b33 |
| turbo-cache-control | no-preview |
| go-import | github.com/PAIR-code/megaplot git https://github.com/PAIR-code/megaplot.git |
| octolytics-dimension-user_id | 29804435 |
| octolytics-dimension-user_login | PAIR-code |
| octolytics-dimension-repository_id | 451893434 |
| octolytics-dimension-repository_nwo | PAIR-code/megaplot |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 451893434 |
| octolytics-dimension-repository_network_root_nwo | PAIR-code/megaplot |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 1d344bdb7547fe6bca17a59bb2b8aac3dc9532a0 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width