Description

The extension has three functions:

  • camera_found()

return 1 if device has at least one camera

return 0 if device has no camera

  • camera_startpreview()

return 1 if camera preview starts with success

return 0 if camera preview could not starts

  • camera_getpicture()

return "" if there is no picture taken

return "{picture_filename}" immediately after the picture is taken

Important! The taken picture is resized to fit maximum size of 2048x2048 pixels.

See the demo application on youtube. Demo application source is available below:

CameraTest Object - Create Event:

if (camera_found()) msg = "Click to take a picture!";
else msg = "No camera found.";
picture_sprite = -1;

CameraTest Object - Global Left Pressed Event:

if(!camera_startpreview()) show_message("Could not start camera preview. Please check log.");

CameraTest Object - Step Event:

var picture_file=camera_getpicture();
if (picture_file!="") {
    if (picture_sprite!=-1) sprite_delete(picture_sprite);//unload old picture
    picture_sprite=sprite_add(working_directory+"/"+picture_file, 1, false, true, 0, 0);
    }

CameraTest Object - Draw Event:

draw_text_transformed(10,10,msg,3,3,0);
if (picture_sprite != -1) {
    var picture_width = sprite_get_width(picture_sprite);//2048px
    var picture_height = sprite_get_height(picture_sprite);
    var resized_width = room_width;
    var resized_height = resized_width * picture_height / picture_width;
    draw_sprite_stretched(picture_sprite,0,0,60,resized_width,resized_height);
    }

More info

End User Licence Agreement (EULA).

Version 1.0.0. Published January 6, 2015

Created with GameMaker: Studio v1.4.1499

Age Rating: 4+

Average Rating

Your review

You can only review assets you've bought.


Gravatar

Alexander H 01 August 2016

Very basic, needs more functionality

The description doesn't give much detail on the actual functionality: the camera_startpreview() function opens the native camera app and then you need to manually snap a picture, which is returned back to the app. This works perfectly fine if you just need to take still photographs, but I was looking for something that could provide a continuous camera feed into the app directly, as I wanted to use it to make an AR game. For the price I was expecting much more out of the extension, as not being able to render the camera feed from within your own game severely limits its usefulness. If the extension could render the camera in real-time within your game rather than relying on another app, it would have significantly more potential.


Gravatar

Ever m 29 July 2016

error

:com.companyname.Android_camera_Cotarlea_Paul:lint FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':com.companyname.Android_camera_Cotarlea_Paul:lint'.
> Lint found errors in the project; aborting build.

Fix the issues identified by lint, or add the following to your build script to proceed with errors:
...
android {
lintOptions {
abortOnError false
}
}
...

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 31.701 secs
Create finished: 11:46:44 AM

Logo

Cotarlea Paul (Publisher) 04 August 2016

Please read this post:
https://forum.yoyogames.com/index.php?threads/android-camera-extension-abortonerror.3081/


Gravatar

Nestor G 09 August 2016

linkone

Cotarlea Paul (Publisher) 04 August 2016

Please read this post:
https://forum.yoyogames.com/index.php?threads/android-camera-extension-abortonerror.3081/

Hi Paul..i see the forum information .how is the correct prosess to change de scripts an fix the extensions,

tanks for any help.

Logo

Cotarlea Paul (Publisher) 04 August 2016

Please read this post:
https://forum.yoyogames.com/index.php?threads/android-camera-extension-abortonerror.3081/


Gravatar

Benjamin C 02 November 2016

Doesn't run (7/24/16)

When I compile, I've tested many times, I get this error

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':com.companyname.Camera:lint'.
> Lint found errors in the project; aborting build.

Fix the issues identified by lint, or add the following to your build script to proceed with errors:
...
android {
lintOptions {
abortOnError false
}
}
...

Logo

Cotarlea Paul (Publisher) 04 August 2016

Please read this post:
https://forum.yoyogames.com/index.php?threads/android-camera-extension-abortonerror.3081/


Gravatar

Robert R 24 March 2017

Works well

This works really well, only drawback is the black screen when it is saving the image and no option to use the front facing camera.


Gravatar

Andreas M 26 October 2015

It just works

Download from market > export to apk > Works
Simple and easy to use.


Gravatar

Peter D 20 August 2015

Looks great!

I've got an Android game called Rotary that generates circular puzzles based on photographs, and since I first developed it in 2012 I've wanted to include a camera function so that players could create custom puzzles. Alas, that's been a pipe dream until the advent of GameMaker Marketplace (and this particular extension). It looks like the 3-year wait has finally paid off, and so far I've been able to implement it into my framework pretty easily. 5 stars!


Gravatar

Steven R 28 January 2015

Works like a charm! I'm excited about this one!!!

I'm developing an app called Warped, which is similar to Photo Warp and Face Warp. Now with this extension, I will now be able to import images from the camera! This is huge!

I downloaded the extension into a new project, then I created the Android APK. This Camera Extension worked without any problems. It accessed the camera app within my tablet and saved the image to the working directory within the Sandbox. The image can then be brought into your app by using the Sprite_Add or Background_Add functions. ((I think the image file is actually a *.jpg file, but that's OK now since GameMaker Studio can now import either *.png, *.gif or *.jpg/jpeg formats.

Thank you Cotarlea Paul for this excellent extension. Perfect timing for what I was needing! I hope to have my Warped app finished soon!


Gravatar

mawika j 09 January 2015

image GMZ 1.4+

image GMZ 1.4+ sprite not jpg
I can not name a jpg image.
I would fix png extension

Logo

Cotarlea Paul (Publisher) 07 January 2015

The type of taken images is: JPEG image data, JFIF standard 1.01

Package contents

Total size 5.1 KB

What is the issue?

Back to Top