Graphics 2.0 Camera Texture fill not working

Hi,

So I upgraded to pro and my first Camera texture fill did not go very well.  I can see the engine attempting to put camera feed on the screen, but it looks locked up to me.  Like a fresh image every minute. 

Here is my very basic code:

local x = display.contentCenterX
local y = display.contentCenterY

local shape = display.newRect( 0, 0, display.contentWidth, display.contentHeight )

shape.fill = { type=“camera” }

I am doing this on an IPAD3

Regards,

Arthur

Hello?

Can I please get some kind of response?  This is the last module in my game.  I would really like to get it done.

Thanks,

Arthur

Maybe you need…

display.setDefault( “forceRender” )

I’m not sure if that is the exact name, but if you look in the docs you will be able to confirm.

This is just a hunch also. If Corona have a camera fill sample, the answer will be located there

Thanks Euhporia I will check that out.

Hello,

I changed the code as followed and it now works:

display.setDrawMode( “forceRender” )

shape = display.newRect( 0, 0, display.contentWidth.5, display.contentHeight.5 )
shape.fill = { type=“camera” }
shape.rotation = -90

Anyone  have any idea why I have to rotate the camera 90 degrees?  Is it because of this build setting:

default = “landscapeRight”,

Thanks,

Arthur

Hello?

Can I please get some kind of response?  This is the last module in my game.  I would really like to get it done.

Thanks,

Arthur

Maybe you need…

display.setDefault( “forceRender” )

I’m not sure if that is the exact name, but if you look in the docs you will be able to confirm.

This is just a hunch also. If Corona have a camera fill sample, the answer will be located there

Thanks Euhporia I will check that out.

Hello,

I changed the code as followed and it now works:

display.setDrawMode( “forceRender” )

shape = display.newRect( 0, 0, display.contentWidth.5, display.contentHeight.5 )
shape.fill = { type=“camera” }
shape.rotation = -90

Anyone  have any idea why I have to rotate the camera 90 degrees?  Is it because of this build setting:

default = “landscapeRight”,

Thanks,

Arthur

Seems to be only working with iOS

Hi @amirfarazmand,

This feature is only available for iOS at this time. Android is not supported.

Best regards,

Brent

How come android developers are second class citizens :slight_smile:

Hi @amirfarazmand,

I don’t regard Android developers as such. :slight_smile: However, on this point, the truth is more complex than it seems. Every Android device manufacturer supplies their own camera app and there is no standard camera app, unlike iOS. This brings about a host of 3rd-party camera driver issues/inconsistencies, along with issues related to the camera’s mounted orientation, rotation, display issues in how some Android devices report the wrong DPI, etc.

Of course we would like to support this functionality for Android in the future, and if you feel strongly about having it, I suggest that you go vote for it in our feedback tool and encourage others to vote for it as well.

feedback.coronalabs.com

Best regards,

Brent

Thanks Brent for clarification. Checking a couple of android barcode scanners they seem to all show full screen camera with a rectangle and line on top, not sure if we can do this is corona putting an object on top of camera.

If this were native, you could use regular Android drawing techniques to draw a box on top of an camera intent and use the native camera interface.   Corona SDK runs on an OpenGL canvas which sits below any native drawing.   We can try to access the camera’s hardware directly to render an OpenGL texture to the canvas, but for Android because there are many many different hardware/driver combos this isn’t practical.  Your barcode example isn’t using OpenGL and doesn’t need the high speed graphics pipeline that Corona SDK uses.

Rob

Thanks Rob.

Seems to be only working with iOS

Hi @amirfarazmand,

This feature is only available for iOS at this time. Android is not supported.

Best regards,

Brent

How come android developers are second class citizens :slight_smile:

Hi @amirfarazmand,

I don’t regard Android developers as such. :slight_smile: However, on this point, the truth is more complex than it seems. Every Android device manufacturer supplies their own camera app and there is no standard camera app, unlike iOS. This brings about a host of 3rd-party camera driver issues/inconsistencies, along with issues related to the camera’s mounted orientation, rotation, display issues in how some Android devices report the wrong DPI, etc.

Of course we would like to support this functionality for Android in the future, and if you feel strongly about having it, I suggest that you go vote for it in our feedback tool and encourage others to vote for it as well.

feedback.coronalabs.com

Best regards,

Brent