dmsdk 0.2.0

Rust-friendly wrappers around the Defold dmSDK
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
//! Defold-specific Lua helpers.

use crate::{dmgameobject, dmvmath, ffi::dmScript, lua};

/// Returns the game object instance the calling script belongs to.
pub fn check_go_instance(l: lua::State) -> dmgameobject::Instance {
    unsafe { dmScript::CheckGOInstance(l.ptr()) }
}

/// Pushes a [`Vector3`](dmvmath::Vector3) onto the stack.
pub fn push_vector3(l: lua::State, v: dmvmath::Vector3) {
    unsafe { dmScript::PushVector3(l.ptr(), &v.into()) }
}