-
Notifications
You must be signed in to change notification settings - Fork 1
gallery
YYBartT edited this page Sep 11, 2024
·
1 revision
This module provides interaction with the gallery.
These are the functions in this module:
This function opens the gallery to select a photo.
This function operates asynchronously, which means that it does not immediately return the requested result. Instead, upon completion of the task, it will trigger the Social Async Event.
Syntax:
MobileUtils_Gallery_Open()
Returns:
N/A
Triggers:
| Key | Type | Description |
|---|---|---|
| type | String | The string "MobileUtils_Gallery_Open"
|
| path | String | The path to the image |
Example:
MobileUtils_Gallery_Open();The code sample above triggers the mobile device gallery overlay, allowing the user to select a photo, this will later trigger a Social Async Event.
if(async_load[?"type"] == "MobileUtils_Gallery_Open")
{
var _path = async_load[?"path"];
MobileUtils_Image_Resize(_path, 300, 300);
MobileUtils_Image_Crop(_path, 100, 100, 100, 100);
Obj_MobileUtils_Gallery_Picture.sprite = sprite_add(_path, 0, 0, 0, 0, 0);
}The code above matches the response against the correct event type and proceeds to resize, crop and load the sprite into a variable.
GameMaker 2026