huxerui.lottie
importLottie vector animation component backed by ThorVG for HuxerUI
import huxerui.lottie;
Module name read from the upstream `export module` declaration in modules/lottie.cppm.
mcpp add huxerui.lottie@0.1.0
Usage
From this repository's own test project — built and run by CI, not written for the website.
import std;
import huxerui;
import huxerui.lottie;
namespace motion = huxerui::lottie;
namespace {
constexpr std::string_view kMotionJson =
R"({"v":"5.7.4","fr":60,"ip":0,"op":60,"w":100,"h":100,"nm":"Moving circle","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Circle","sr":1,"ks":{"o":{"a":0,"k":100},"r":{"a":0,"k":0},"p":{"a":1,"k":[{"t":0,"s":[20,50,0],"e":[80,50,0],"o":{"x":0.333,"y":0.333},"i":{"x":0.667,"y":0.667}},{"t":60,"s":[80,50,0]}]},"a":{"a":0,"k":[0,0,0]},"s":{"a":0,"k":[100,100,100]}},"shapes":[{"ty":"el","p":{"a":0,"k":[0,0]},"s":{"a":0,"k":[20,20]},"d":1,"nm":"Ellipse"},{"ty":"fl","c":{"a":0,"k":[1,0,0,1]},"o":{"a":0,"k":100},"r":1,"nm":"Red"}],"ip":0,"op":60,"st":0,"bm":0}]})";
std::function<huxerui::View()> g_root;
huxerui::View RootView() { return g_root(); }
void Require(bool condition, std::string_view message) {
if (!condition) {
throw std::runtime_error(std::string{message});
}
}
template <class Ex, class Fn>
void RequireThrows(Fn&& fn, std::string_view message) {
// …
tests/examples/huxerui-lottie/tests/lottie.cpp · project tests/examples/huxerui-lottie
Build · upstream manifest
- modules
huxerui.lottie- targets
huxerui_lottie (lib), lottie (lib)- language
c++23- manifest version
0.1.0- dependencies
huxerui, compat- source
https://raw.githubusercontent.com/HuxerUI/Lib-Lottie/v0.1.0/mcpp.toml
Versions
| Version | Platforms | Mirrors | sha256 |
|---|---|---|---|
0.1.0 latest |
LinuxWindowsmacOS | source | d4c122867e3b… |