MCPcopy Create free account
hub / github.com/LibreSprite/LibreSprite / CelScriptObject

Method CelScriptObject

src/app/script/api/cel_script.cpp:16–30  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14class CelScriptObject : public script::ScriptObject {
15public:
16 CelScriptObject() {
17 addProperty("x",
18 [this]{return cel()->x();},
19 [this](int x){cel()->setPosition(x, cel()->y()); return x;});
20 addProperty("y",
21 [this]{return cel()->y();},
22 [this](int y){cel()->setPosition(cel()->x(), y); return y;});
23 addProperty("image", [this]{return getEngine()->getScriptObject(cel()->image());});
24 addProperty("frame", [this]{return cel()->frame();});
25
26 addFunction("setPosition", [this](int x, int y){
27 cel()->setPosition(x, y);
28 return this;
29 });
30 }
31
32 doc::Cel* cel() {
33 auto cel = handle<doc::Object, doc::Cel>();

Callers

nothing calls this directly

Calls 6

getScriptObjectMethod · 0.80
xMethod · 0.45
setPositionMethod · 0.45
yMethod · 0.45
imageMethod · 0.45
frameMethod · 0.45

Tested by

no test coverage detected