Skip to content

Copycat object

Steven Johnson edited this page Jan 24, 2019 · 13 revisions

TODO: Fill this in!

(This is basically revisiting the idea here in light of some ideas hashed out in the other page mentioned next.)

There are some opportunities here that present themselves, for instance re-introducing objects into the rendering stream as suggested here.

In reviewing a bit, probably graphics or display object methods would provide a means to do this, where supported (it's genuinely difficult for some cases, e.g. groups, lines, meshes), or else the objects in question could expose such a method, if it was felt that the result could measure up to the challenge!

Once instantiated, the relevant properties could probably be enumerated, on first use, by what the object in question provides, otherwise providing nil. (TODO: Off-hand, three different means of instantiation.) Before submission, would query a dirty flag and synchronize propertties.

In practice we might want to be explicit that we're using a copycat? So, e.g. stuff like xCopy or setFrameCopy(), although that looks a little annoying. Not sure here.

Some things, given their current list of behaviors, would be "easy" to do, e.g. circles, rects, polygons, probably images and sprites, maybe emitters.

Meshes seem feasible although you'd need to resync the lists if it was allowed to only modify individual vertices, uvs, etc.

Lines present a complication, since adding vertices is cumulative and there's no "correct" way to proceed once the two diverge.

The various group-ish things (vanilla groups, containers, snapshots) also seem like major headaches, and probably worth just omitting.

This is medium- to high-priority, if it does ultimately seem the way to go.