Last active 4 months ago
Hmm.. The issue is, that this public version is no longer being updated, therefore that would not help too much..
just a fast answer - currently not near a PC to check your code..
Instead of restarting the engine after ALT+TAB just press ALT once when the IDE is open - afterwards it should be working again as it should.
jep... german keyboard layouts are not fully supported.
just something I discovered in your code:
look at the first line:
Services.Input:addEventListener(nil, onKeyDownEvent, InputEvent.EVENT_KEYDOWN)
where is onKeyDownEvent?
(I actually think you can just leave that line away and just use the function onKeyDown - this will be called automatically..)
There's a difference how you call the application: if you start it from the terminal it makes a difference if you call it via
PolycodeDir/Polycode or directly from within the Polycode folder with
Polycode as the working directory (the starting point for relative path names) is another one..
You can specify the working directory in .desktop files with the path property as described here: https://linuxcritic.wordpress.com/2010/04/07/anatomy-of-a-desktop-file/ please set it to the directory in which the binary is found.
Maybe you forgot to set the working directory to your polycode folder?
you created the Crab object before by calling
crab = Crab() ?
No other idea, as I'm not using Lua..
did you have a look at: http://polycode.org/learn/events#lua ?
you don't have to create an extra class for every handled event - just declare a function and register a callback for that:
okButton:addEventListener(nil, onOkButton, UIEvent.CLICK_EVENT)
that function should look like the onCollision here:
you can then cast the event parameter:
local uiEvent = safe_cast(event, UIEvent)
to get access to ui event specific information.
by using get
uiEvent:getDispatcher() you should be able to do the same differentiation as in C++
Hope I could help!
don't miss to declare
class "Crab" at the beginning of the file
hmm... not sure - maybe have a look here (bit too tired to answer directly..):