#include <filesystem>
#include <xtd/xtd>
using namespace std;
namespace animation_example {
class form1 :
public form {
public:
form1() {
back_color(colors::dark_cyan());
client_size({360, 280});
controls().push_back(fish_animation);
fore_color(colors::cyan());
text(
"Animation example");
fish_animation.dock(dock_style::fill);
fish_animation.frames_per_second(60);
fish_animation.start();
fish_animation.click +=
event_handler(*
this, &form1::on_fish_animation_click);
}
private:
void on_fish_animation_click(
object& sender,
const event_args&
e) {
fish_animation.running(!fish_animation.running());
}
static const auto fish_length = 16;
auto points = vector<point_f> {};
for (
auto i = 0;
i < fish_length; ++
i) {
auto radius = 100 + 10 * sin(
as<float>(fish_animation.frame_counter()) * 0.1
f +
as<float>(
i) * 0.5f);
}
}
}
};
}
auto main()->int {
df.fore_color(basic_colors::lime());
application::run(animation_example::form1 {});
}