LogoPixi’VN

Flags management

Explains how to use boolean flags in Pixi’VN to control game flow.

Pixi’VN provides functions to manage "game flags". Game flags are boolean values used to control the flow of the game or to store other boolean value in the game storage.

This mechanic has much less impact on save size than saving a boolean in game storage.

设置

To set a flag, use the storage.setFlag function. 该函数具有以下参数:

  • name: The flag name.
  • value: The flag value.
import { storage } from '@drincs/pixi-vn'

storage.setFlag('flag1', true)

获取

To get a flag, use the storage.getFlag function. 该函数具有以下参数:

  • name: The flag name.
import { storage } from '@drincs/pixi-vn'

const flag1 = storage.getFlag('flag1')

其他叙事功能

On this page