I imported an image into PE, traced it and exported the .lua file out for Corona. Applied the physics properties in Kwik with polygon/PE and got the error: ribbon1.lua:73: bad argument #1 to 'unpack' (table expected, got nil)Line 73 is: return unpack(self.data[name])Opening ribbon1.lua and commenting out that line results in a successful Kwik build, but not with the expected outcome.I was using the external code of:system.setAccelerometerInterval(100)function onTilt( event ) physics.setGravity( ( 9.8 * event.xGravity ), ( -9.8 * event.yGravity ) )endRuntime:addEventListener( "accelerometer", onTilt )To make a ribbon float around on the screen the direction the user tilts the device, but now the ribbon just goes random directions. That could be my code and not Kwik, though. However, I'm not sure why PE is creating a line of code that gives Kwik an error.
Remember that you must name your object in PE with the same name of the exported image (not the layer name). For example, if your layer is called “abc” but, after publishing its name becomes “p1_abc”, this is the object name you have to use with PE.
Ahhh yes, the “p1_” prefix was the issue. Now I just have to figure out why my accelerometer code is going nuts. ;D
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic.
When you visit any website, it may store or retrieve information on your browser, mostly in the form of cookies. This information might be about you, your preferences or your device and is mostly used to make the site work as you expect it to. The information does not usually directly identify you, but it can give you a more personalized web experience.