Send msg from ne?

Can i send msg from native?
I need to change sprite animation and disable/enable sprite.

    msg.post("#sprite", "play_animation", {id = hash("jump")})

You would have to set up a Lua function “message relay” to callback to and then make that function send the message I think? DefOS has example of Lua function callback with the function to check if cursor is within window.

1 Like

You should be able to get the msg.post function from the global table via the Lua C API and invoke the function from C. Never tried to do it but it should work. It’s kinda hacky and I would much rather that our Defold SDK provides this.

3 Likes