Flow > Advanced


Code

Code Block (Single Line, Multi Line)

code text
code text

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 text

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


Constants

Game URL

game url

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

gameURL()

language

language

The language code of the system (device) on which the game is running.

openfl.system.Capabilities.language

Step Size

step size

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()

null

null

Returns "null", which stands for the absence of a value.

null

Platforms

Running on Platform

running on platform

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

Choices:

#if(PLATFORM) true #else false #end

Running on Specific iOS Device

running on device

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(ios) Engine.isStandardIOS #else false #end
#if(ios) Engine.isExtendedIOS #else false #end
#if(ios) Engine.isIPhone6 #else false #end
#if(ios) Engine.isIPhone6Plus #else false #end
#if(ios) Engine.isTabletIOS #else false #end
#if(ios) Engine.isIPhoneX #else false #end
#if(ios) Engine.isIPhoneXMax #else false #end
#if(ios) Engine.isIPhoneXR #else false #end

Do only on Platform

do only on platform

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 game

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

load atlas with id int

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

loadAtlas([INT]);
unloadAtlas([INT]);

Is Atlas Loaded?

atlas with id int is loaded

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

atlasIsLoaded([INT])