GameMaker (all)
Icon

CamSurface

GM++

You must be logged in to obtain assets

Description

GMS1 and 2 - Android Only

Use the front or back camera as a native Gamemaker surface in your games and applications!

DOWNLOAD A DEMO APK

  • Landscape and portrait camera mode
  • Turn the flashlight on and off during preview
  • High speed access to the colour data from the camera (could be used for tracking and detection etc.)

Since the camera is returned as a native Gamemaker surface, you can use the surface as you would a regular sprite, background as well. Draw it with shader effects, use it as a texture for a model, and any other applications you can think of!

Easy to set up and implement (working demo is included). Call the following function to start the camera preview:

  camsurface_start(CAMSURFACE_PORTRAIT,CAMSURFACE_CAM_BACK,640,480);
//camsurface_start(portrait|landscape,front|back,width,height);

To draw the camera to the screen, there are two options. Either retrieve the surface index and operate with that, or use the inbuilt drawing function:

camsurface_draw(x,y[width,height])

// --- OR --- //

var surface = camsurface_get_surface();

if (surface_exists(s)) {
    draw_surface(surface, x, y);
}

On newer phones the camera can run at up to 30fps (independent of the room speed) @ 720p. Slightly smaller resolutions on older phones runs exponentially faster.

Make sure to set the minimum android sdk to 17 in Global Game Settings.

Need an Android extension or SDK Implementation?

More Assets:

GMLVideo

SafeSave

Easy Google Analytics

WebView

End User Licence Agreement (EULA).

Age Rating: 4+

Versions

GMS1 - Version 0.0.4. Published May 16, 2017

GMS2 - Version 0.0.5. Published August 4, 2017

Loading, please wait

Package contents

Loading, please wait

What is the issue?

Loading, please wait