This is used by MiddleWare to inject event handlers into the sprite.
This should be called on the svg element that the mouse interacts with
(which may be different from the top-level svg element).
This is the entity that is associated with this Sprite. We pass this
into present
because present
attaches handlers to the generated svg
that need to report events that reference ent
.
This is the initial value of the subacset that specifies the properties
for the sprite. In most cases, we are just interested in the top-level
properties, but sometimes we use the parts inside to, for instance,
display ports. Most of the time, one should get properties from
updates
, as those will change over time, but there may be some things
that you need in order to construct the svg that will never change, and
those can be taken from init
.
This is the same data as init
, except changing over time. This should
be used to, for instance, set the center of the Sprite, because then the
center will change when the Sprite is dragged.