Flow > Advanced


Code

Code Block (Single Line, Multi Line)

code-block
code-block

Lets you embed code into your Behavior. Can be used in many ways. Particularly useful for calling functions that Stencyl or Haxe provide but don't exist in block form. Take a look at our API to see what's available.


Code Block (Inline)

code-block

Lets you embed a fragment of code into a block field.


Constants

Current Scale

scale-block

Returns the current scale of the game. Either 1, 1.5, 2, 3 or 4.

Engine.SCALE

Game URL

game-url-block

Returns the URL of the website where this game is running (on Flash, HTML5). Returns an empty text on other platforms.

gameURL()

Step Size

step-size-block

Returns the number of milliseconds in each "step" of the game. This corresponds to the time elapsed between updates to when updating events. The default step size is 10 milliseconds.

getStepSize()

Platforms

Running on Platform

do-platform-block

Returns true if the game is running on the selected platform.

Choices:

#if(PLATFORM) true #else false #end

Running on Specific iOS Device

do-platform-block

Returns true if the game is running on the selected kind of iOS device. Useful if you want to fine-tune a game's display or behavior on specific devices.

Choices:

#if(mobile && !android) Engine.isStandardiOS #else false #end
#if(mobile && !android) Engine.isExtendedIOS #else false #end
#if(mobile && !android) Engine.isIPhone6 #else false #end
#if(mobile && !android) Engine.isIPhone6Plus #else false #end
#if(mobile && !android) Engine.isTabletIOS #else false #end

Do only on Platform

do-platform-block

Include the wrapped blocks only on the specified platform. On other platforms, the wrapped blocks will not exist at all.

Choices:

#if(PLATFORM)
[ACTIONS]
#end

Exit Game

exit-block

Quits out of a Desktop game or standalone Flash game. Does nothing on Flash/HTML5 running in a browser. On iOS/Android, it may send the app to the background (and goes against platform guidelines).

exitGame();

Memory Management

These blocks are deprecated. We now recommend handling atlases entirely using the Atlas page.

Load / Unload Atlas

atlas-block

Tells the game to load (or unload) an atlas in the next scene. Specify the Atlas ID.

loadAtlas([NUMBER]);
unloadAtlas([NUMBER]);

Is Atlas Loaded?

atlas-check-block

Returns true if the specified atlas (using Atlas ID) is currently loaded.

atlasIsLoaded([NUMBER])