Perspective View build error

Hey there everyone! So I am currently using the Perspective View library. The game works flawless, but when I attempt to build it for android I get the following error posted below. The code it is referencing is:

local camera = perspective.createView([numLayers]) -- Optional parameter is the number of layers

Again, I get no errors when actually running the game in the engine. Only during build time when connecting to the servers. The error is random and doesn’t get detected at any other time as an error. I’m not sure if I am doing something wrong within my class or not. Has anyone else gotten this issue? I can post that code up as well if whoever reads this would like.

Thanks for reading.

So upon testing, I figured out what the issue is. Line 3 and 7 in the pseudo_code.lua file, which are:

local camera = perspective.createView([numLayers]) camera:add(obj, layer, [isFocus])

When you launch the Corona client and run your game in the simulator, the library works great. But when you build for Android, you get the error in the post above. I’m not sure about iOS, but I can test for that too. When you take the array brackets out of the parameters for the methods createView and add, which looks like this:

local camera = perspective.createView(numLayers) camera:add(obj, layer, isFocus)

The program is still able to run as well as able to build for your device. I’m not sure if there is a more serious internal issue going on, or not. I just wanted to let everyone know, and hopefully Caleb see’s this. This library is awesome by the way. Thanks Caleb.

While I can’t really provide support for this library since I’ve never used it, in general when reading documentation when you see a parameter inside square brackets [] it means it’s optional.  In other words you can provide a number of layers you want when you invoke .createView.  The parameter is optional, but other wise its expecting either a number or a variable that has a number in it.

Likewise line 3 above [isFocus] is optional and I’m guessing its a boolean (true or false), but because I don’t know the library I can’t be for sure on that.

But if you have not defined isFocus, then you will be passing a nil in there which should be the same as if you left the optional parameter out (same with numLayers).

You definitely cannot use the [] as part of your syntax though.  That will cause the error you’re getting.

Rob

So upon testing, I figured out what the issue is. Line 3 and 7 in the pseudo_code.lua file, which are:

local camera = perspective.createView([numLayers]) camera:add(obj, layer, [isFocus])

When you launch the Corona client and run your game in the simulator, the library works great. But when you build for Android, you get the error in the post above. I’m not sure about iOS, but I can test for that too. When you take the array brackets out of the parameters for the methods createView and add, which looks like this:

local camera = perspective.createView(numLayers) camera:add(obj, layer, isFocus)

The program is still able to run as well as able to build for your device. I’m not sure if there is a more serious internal issue going on, or not. I just wanted to let everyone know, and hopefully Caleb see’s this. This library is awesome by the way. Thanks Caleb.

While I can’t really provide support for this library since I’ve never used it, in general when reading documentation when you see a parameter inside square brackets [] it means it’s optional.  In other words you can provide a number of layers you want when you invoke .createView.  The parameter is optional, but other wise its expecting either a number or a variable that has a number in it.

Likewise line 3 above [isFocus] is optional and I’m guessing its a boolean (true or false), but because I don’t know the library I can’t be for sure on that.

But if you have not defined isFocus, then you will be passing a nil in there which should be the same as if you left the optional parameter out (same with numLayers).

You definitely cannot use the [] as part of your syntax though.  That will cause the error you’re getting.

Rob