Serializable classes must either be able to safely call new() with no parameters (for assignment to serialized version) or implement toJSON():serialized_form and static fromJSON(data:serialized_form), the latter of which returns a new instance of the class.
Generated using TypeDoc
AObjectState Decorator
The
@AObjectState
decorator and AObjectState The @AObjectState decorator lets you declass state variables on a class that extends AObject (as is the case here, because A2DSceneNode already extends AObject). AObjectState variables are tracked in a special way so that other code can listen for changes to those variables. This will let us, for example, specify a callback function to be executed whenever a particular AObjectState variable is changed. In this assignment, clicking and dragging a point or a line will cause its coordinates to change. Our view of said point/line will listen for changes to this state so that we can keep our visualization (graphics) up to date. Side Note: for the curious, the state variables for each AObject are stored in what's called aproxy
. More specifically, AniGraph uses a valtio proxy proxt under the hood.Limitations: