rive-app / rive-cpp

C++ runtime for Rive
MIT License
278 stars 42 forks source link

Support for align action. #344

Closed luigi-rosso closed 2 years ago

luigi-rosso commented 2 years ago

Adds support for the align action as discussed in these threads: https://2dimensions.slack.com/archives/CHMAP278R/p1655506259768229 https://2dimensions.slack.com/archives/CHMAP278R/p1655592967543899

I'm specifically calling Actions anything that internally happens in response to a Listener (used to be just an input change but now will be generalized as the things listed in the diagram below) and an Event is a high-level external output from the StateMachine.

listeners + internal actions

Note that FireEvent isn't implemented yet but is called out as an example of another possible Action that a Listener will trigger.

csmartdalton commented 2 years ago

Quick question I had -- why the distinction between ListenerAction and ListenerActionBase? Why do these need to be separate classes?

luigi-rosso commented 2 years ago

All the *Base classes are generated by our Core generator (reads the .json files in the defs folder and writes Base classes that handle serialization/deserialization and some RTTI like functionality).

csmartdalton commented 2 years ago

Oooh, that's cool! Thanks for clarifying