Skip to content

gallery

YYBartT edited this page Sep 11, 2024 · 1 revision

Gallery

This module provides interaction with the gallery.

Functions

These are the functions in this module:



Back To Top

MobileUtils_Gallery_Open

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:

Social Async Event

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.



Clone this wiki locally