image

PP.assets. image

The namespace containing functions to load and manage image assets
Source:

Methods

(static) add(scene, image, x, y, pivot_x, pivot_y)

Add and position a new image into the scene.
Source:
Parameters:
Name Type Description
scene object The scene object where to add the image.
image object The object of an image returned by PP.assets.image.load
x number The horizontal initial position in pixels of the image.
y number The vertical initial position in pixels of the image.
pivot_x number The pivot X position **in percentage ** from 0 to 1.
pivot_y number The pivot Y position **in percentage ** from 0 to 1.
Returns:
An image object representing the specific image added to the scene.

(static) load(image_path)

Load a new image.
Source:
Parameters:
Name Type Description
image_path string A path of the image to load. It can be relative to the current page or a full URL.
Returns:
An image object representing the image file itself.