rocinantealpha

reference / pictures

load

Loads a picture from the sketch's assets folder by its file name (PNG, JPEG, BMP, TGA or QOI): photo = load "cat.png". A picture knows its size in pixels: photo.width and photo.height, which can be read and not changed. A picture that is not there gives an empty one, which draws nothing.

photo = load "landscape.png"print ("the picture is " + photo.width + " by " + photo.height)image photo at 40 50 width 320

It prints

the picture is 320 by 200
what it draws: the whole window, 400 by 300
What the example of load draws

How to write it

load name

Gives a picture.

Related