Sound & Images > Images

Read our Image API guide for an explanation of these blocks.

Create Images

Create Blank Image


Create a blank image of the specified width and height. Usually assigned to an Image attribute right away.

new BitmapData([NUMBER] * Engine.SCALE, [NUMBER] * Engine.SCALE, true, 0)

Copy of Image


Returns a copy of the specified image. This is a true copy, so altering the copy will not affect the original.


Part of Image


Returns the specified part of the image as a new image.


Resized Copy of Image


Returns a larger (or smaller) copy of the image. Width and height are given as percentages - 100% means keep it the same, 200% means double, 50% means half.

resizeImage([IMAGE], ([NUMBER]/100), ([NUMBER]/100), true)

//No Smoothing
resizeImage([IMAGE], ([NUMBER]/100), ([NUMBER]/100), false)

From the Game

Current Screen as Image


Captures the current screen as an image and returns that. This takes time (it may pause the game for a a tenth of a second), so use it sparingly.


Image from Actor


Returns the current image for the specified actor. (In other words, the exact visual state of the actor at the time that you use this.)


From External Sources

Image from File


Returns an image that is loaded from a file. Images must be placed into the extras subfolder of your game.


Load Image from URL


Returns an image that is loaded from a URL. When the image successfully loads, the enclosed blocks will run. Use the embedded the image block to refer to the loaded image. If the image does not load, the enclosed blocks will not run.

For a Flash game you may need to give permissions to access the web.

loadImageFromURL([TEXT], function(img:BitmapData):Void {

Convert Image to/from Text

Image to Text


Converts an image into text form and returns that. Useful for storing image data on servers (via an HTTP request). This takes time to run (a split second or longer).


Text to Image


Returns an image that was converted to text using the prior block. This takes time to run (a split second or longer).