var Clay = Clay || {};
// GameMaker related data is stored here... (a lot of callback stuff)
Clay['gamemaker'] = Clay['gamemaker'] || {};

/**
 * 
 * SCREENSHOT FUNCTIONS
 *  
 */

Clay['gamemaker']['screenshotTaken'] = false;
function clay_screenshot_take()
{
	var screenshot = new Clay['Screenshot']( { prompt: false } );
	Clay['gamemaker']['screenshotTaken'] = false;
	screenshot.save( function( response ) {
		if( response.success )
			Clay['gamemaker']['screenshotTaken'] = response;
	} );
}

function clay_screenshot_taken_ready()
{
	return clay_check_ready( Clay['gamemaker']['screenshotTaken'] );
}

function clay_screenshot_taken_image_url()
{
	if( clay_screenshot_taken_ready() )
	{
		return Clay['gamemaker']['screenshotTaken']['imageSrc'];
	}
}

function clay_screenshot_taken_link()
{
	if( clay_screenshot_taken_ready() )
	{
		return Clay['gamemaker']['screenshotTaken']['url'];
	}
}