Skip to content

C++: Simple Publishers, AnimatedSpriteRenderer

Choose a tag to compare

@coinbump coinbump released this 12 May 14:29
· 76 commits to main since this release

What's New in v2.34

  • Added simple publisher/subscription support to C++ for observing values, renamed old PublishedValue to BroadcastValue
  • Use Reactive publisher in SliderControl2D
  • New AnimatedSpriteRenderer for rendering animations based on a set of textures
  • Separate SDL drop files events are now batched into a single DropFilesUIEvent to allow easier drag-and-drop of animation frames into Kaiju

Animation example

auto meshNode = MAKE<WorldNode>();
auto renderer = MAKE<AnimatedSpriteRenderer>(textures);
meshNode->AddComponent(renderer);

auto material = renderer->material;

auto program = GLShaderProgram::registry["texture.uniform"];
if (program) {
    material->shaderProgram = program;
    material->features[RenderFeatures::Blend] = RenderFeatureStatus::Enable;
}
meshNode->transform->SetWorldPosition(Vector3(0, 0, -0.2f));

world.Add(meshNode);