williamngan / pts

A library for visualization and creative-coding
https://ptsjs.org
Apache License 2.0
5.16k stars 182 forks source link

feat: custom animateId #206

Closed alexander-welshtein closed 6 months ago

alexander-welshtein commented 8 months ago

Hi! This tiny change allowed us to get rid of the headache of connecting objects and drawing them in interactions.

netlify[bot] commented 8 months ago

Deploy Preview for astronaut-horse-32874 ready!

Name Link
Latest commit 50289d64667bcc588bf680fefcc0ac8d3bb77a87
Latest deploy log https://app.netlify.com/sites/astronaut-horse-32874/deploys/657f5d608f0c1d0008b5b05f
Deploy Preview https://deploy-preview-206--astronaut-horse-32874.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

williamngan commented 7 months ago

Hi @alexander-welshtein - sorry I totally missed PR. If this is still an issue for you, can you describe it with more details?

alexander-welshtein commented 6 months ago

Hi @alexander-welshtein - sorry I totally missed PR. If this is still an issue for you, can you describe it with more details?

Thanks for your tool. In short, we use "IPlayer" to control the display cycle of shapes in the workspace. For example, adding via space.add() and removing via space.remove(). At the same time, we do not store the β€œIPlayer” object itself (and to be honest, at that time I did not find a way to get it), so to delete it we need to know the ID. For example, space.remove({ animateID: customId }). But for this we need to set the ID when creating "IPlayer" through space.add({ animateID: customId }).

It is possible that returning "IPlayer" from space.add() could solve the problem, but in our case, using a custom ID is the most easy way.

Perhaps at that time we could have missed something in the documentation, but now our working solution depends on the fork in which this ID can be specified.

williamngan commented 6 months ago

@alexander-welshtein - Yes I see. It makes sense. Is it ok if I reopen this PR and merge it?

alexander-welshtein commented 6 months ago

@alexander-welshtein - Yes I see. It makes sense. Is it ok if I reopen this PR and merge it?

Yes, let's do it, thanks