I truly like what I see so far in terms of having a 3D Lua framework. However, some things are puzzling / annoying me so far (Windows 10 64 Bit, v0.8.4):
- Tabbing in and out of the application is regularily killing keyboard input for me, requiring me to restart the IDE
- I can't access curly brackets (problem with german keyboard layout?)
- Running this code
Services.Input:addEventListener(nil, onKeyDownEvent, InputEvent.EVENT_KEYDOWN) scene = Scene(Scene.SCENE_3D) sceneEntity = SceneEntityInstance(scene, "Resources/scene.entity") scene:addChild(sceneEntity) camera = safe_cast(sceneEntity:getEntityById("main_camera", true), Camera) scene:setActiveCamera(camera) playerx = 0 playery = 0.5 playerz = 0 function Update(elapsed) camera:setPosition(playerx,playery,playerz) end function onKeyDown(key) if key == KEY_LEFT then print("LEFT WAS PRESSED") end end
LEFT WAS PRESSED
Error in file Scripts/Main.lua on line 51
attempt to call field 'callback' (a nil value)
In file Scripts/Main.lua on line 51
Line 51? My program is just 23 lines long and the onKey should not generate an error, should it?
Any help would be highly appreciated, thanks!