Replies: 1 comment
-
|
I have added some notes about this in the Using Shared Objects documentation page and have just added a new page "Sharing p5.Color + p5.Vector Objects" https://www.notion.so/Sharing-p5-Color-p5-Vector-Objects-c7924c9d608f4d8781402652336bcb2a It addresses Colors! I am working on adding some "friendly warnings" if p5.party detects that unserializable data is assigned to a shared property. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I recently ran into an issue when trying to put a vector on a shared object as it seems to internally reference the entire p5 library. A simple workaround Justin suggested was to simplify it by creating my own 'vector' object that only contained the x and y variables that I needed.
The same issue occurs when trying to share other objects. For example, colours, sliders, and other DOM elements.
I'm interested in how we can use a similar methodology to simplify other complex data objects and DOM elements. For example, you can break down colour into a simple data object to then share. Something along these lines would work:
Beta Was this translation helpful? Give feedback.
All reactions