mirror of
https://github.com/enduro2d/enduro2d.git
synced 2025-12-14 08:07:17 +07:00
camera flag binds
This commit is contained in:
@@ -6,6 +6,12 @@ local camera = {
|
||||
---@type boolean
|
||||
disabled = false,
|
||||
|
||||
---@type boolean
|
||||
input = false,
|
||||
|
||||
---@type boolean
|
||||
gizmos = false,
|
||||
|
||||
---@type integer
|
||||
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(
|
||||
[](const gcomponent<camera>& c) -> i32 {
|
||||
return c->depth();
|
||||
|
||||
Reference in New Issue
Block a user