Remove element script and allow images to be pixel updated for similar behaviour

This commit is contained in:
2026-06-05 11:00:15 +01:00
parent e7418fde08
commit 419e95ac89
9 changed files with 177 additions and 518 deletions
+1 -30
View File
@@ -8,8 +8,7 @@
enum Type { IMAGE,
TEXT,
RECT,
SCRIPT };
RECT };
enum ClickMode { PASS,
BLOCK,
@@ -83,34 +82,6 @@ struct ERect : Element {
void render(uint64_t) override;
};
struct EScript : Element {
Ruby::Block script;
uint64_t scripted_id = UINT64_MAX;
bool pixel_art = false;
Vec2<float> shape;
EScript(Vec2<float> shape) : Element(Type::SCRIPT), shape(shape) {
scripted_id = window.create_scripted(shape, pixel_art);
}
~EScript() {
if (scripted_id != UINT64_MAX)
scripted_pool.release(scripted_id);
};
Vec2<float> size() override {
return shape;
}
bool update_scripted(Rect content_rect, const char *new_content, uint32_t length) {
return window.update_scripted(scripted_id, content_rect, new_content, length);
}
void render(uint64_t) override {
window.draw_scripted(scripted_id, position, z, rotation, pivot, scale, alpha);
};
};
inline Pool<Element> element_pool;
} // namespace app