mirror of
https://github.com/enduro2d/enduro2d.git
synced 2025-12-14 16:09:06 +07:00
camera flag binds
This commit is contained in:
@@ -6,6 +6,12 @@ local camera = {
|
|||||||
---@type boolean
|
---@type boolean
|
||||||
disabled = false,
|
disabled = false,
|
||||||
|
|
||||||
|
---@type boolean
|
||||||
|
input = false,
|
||||||
|
|
||||||
|
---@type boolean
|
||||||
|
gizmos = false,
|
||||||
|
|
||||||
---@type integer
|
---@type integer
|
||||||
depth = 0,
|
depth = 0,
|
||||||
|
|
||||||
|
|||||||
@@ -50,6 +50,32 @@ namespace e2d::bindings::high
|
|||||||
}
|
}
|
||||||
),
|
),
|
||||||
|
|
||||||
|
"input", sol::property(
|
||||||
|
[](const gcomponent<camera>& c) -> bool {
|
||||||
|
return c.owner().component<camera::input>().exists();
|
||||||
|
},
|
||||||
|
[](gcomponent<camera>& c, bool yesno){
|
||||||
|
if ( yesno ) {
|
||||||
|
c.owner().component<camera::input>().ensure();
|
||||||
|
} else {
|
||||||
|
c.owner().component<camera::input>().remove();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
),
|
||||||
|
|
||||||
|
"gizmos", sol::property(
|
||||||
|
[](const gcomponent<camera>& c) -> bool {
|
||||||
|
return c.owner().component<camera::gizmos>().exists();
|
||||||
|
},
|
||||||
|
[](gcomponent<camera>& c, bool yesno){
|
||||||
|
if ( yesno ) {
|
||||||
|
c.owner().component<camera::gizmos>().ensure();
|
||||||
|
} else {
|
||||||
|
c.owner().component<camera::gizmos>().remove();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
),
|
||||||
|
|
||||||
"depth", sol::property(
|
"depth", sol::property(
|
||||||
[](const gcomponent<camera>& c) -> i32 {
|
[](const gcomponent<camera>& c) -> i32 {
|
||||||
return c->depth();
|
return c->depth();
|
||||||
|
|||||||
Reference in New Issue
Block a user