Remove element script and allow images to be pixel updated for similar behaviour
This commit is contained in:
+1
-30
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user