allegroflare / allegro_flare

Application toolkit for Allegro 5
https://clubcatt.com/allegroflare
MIT License
35 stars 6 forks source link

Create MotionComposer (notes) #232

Open MarkOates opened 2 years ago

MarkOates commented 2 years ago

🖥 Display Client

Messages

🎮 Control Client

Messages

MarkOates commented 2 years ago

Theoretical example of JSON object of the actor:

"actors": [
  {
    "type": "Actor2D"
    "id": 12
    "params": [
       {
          "name": "opacity",
          "keyframes": [
             {
                "time": 0.5,
                "value": 2.0,
                "interpolator": "linear" 
             }
          ]
       }
    ]
  }
MarkOates commented 2 years ago

To create a new message, you would need to create a few supporting classes. Note cg is an alias for the component_generator program from Blast.

If your new class was "AddActor2D":

cg AllegroFlare/MotionComposer/Messages/AddActor2D derived
cg AllegroFlare/JSONLoaders/AllegroFlare/MotionComposer/Messages/AddActor2D json_loader
cg AllegroFlare/Testing/Comparison/AllegroFlare/MotionComposer/Messages/AddActor2D comparison

For each of these classes you would implement their logic. This includes logic for converting to and from JSON, as well as an operator== so that tests can be built.

Also, you would need to add a few new entries into the system: