Namespace: Utils

Utils

The static class that defines utility methods.

Members

Utils.RPGMAKER_NAMEstringstaticconstant

The name of the RPG Maker. "MZ" in the current version

Utils.RPGMAKER_VERSIONstringstaticconstant

The version of the RPG Maker

Methods

Utils.canPlayOgg()booleanstatic

Checks whether the browser can play ogg files
Returns:
TypeDescription
booleanTrue if the browser can play ogg files

Utils.canPlayWebm()booleanstatic

Checks whether the browser can play webm files
Returns:
TypeDescription
booleanTrue if the browser can play webm files

Utils.canUseCssFontLoading()booleanstatic

Checks whether the browser supports CSS Font Loading
Returns:
TypeDescription
booleanTrue if the browser supports CSS Font Loading

Utils.canUseIndexedDB()booleanstatic

Checks whether the browser supports IndexedDB
Returns:
TypeDescription
booleanTrue if the browser supports IndexedDB

Utils.canUseWebAudioAPI()booleanstatic

Checks whether the browser supports Web Audio API
Returns:
TypeDescription
booleanTrue if the browser supports Web Audio API

Utils.canUseWebGL()booleanstatic

Checks whether the browser supports WebGL
Returns:
TypeDescription
booleanTrue if the browser supports WebGL

Utils.checkRMVersion(version)booleanstatic

Checks whether the current RPG Maker version is greater than or equal to the given version.
NameTypeDescription
versionstringThe "x.x.x" format string to compare
Returns:
TypeDescription
booleanTrue if the current version is greater than or equal to the given version.

Utils.containsArabic()booleanstatic

Checks whether the string contains any Arabic characters
Returns:
TypeDescription
booleanTrue if the string contains any Arabic characters

Utils.decryptArrayBuffer(source)ArrayBufferstatic

Decrypts encrypted data
NameTypeDescription
sourceArrayBufferThe data to be decrypted
Throws:
Error if there is a decryption error
Returns:
TypeDescription
ArrayBufferThe decrypted data

Utils.encodeURI(str)stringstatic

Encodes a URI component without escaping slash characters
NameTypeDescription
strstringThe input string
Returns:
TypeDescription
stringThe encoded string

Utils.escapeHtml(str)stringstatic

Escapes special characters for HTML
NameTypeDescription
strstringThe input string
Returns:
TypeDescription
stringThe escaped string

Utils.extractFileName(filename)stringstatic

Gets the filename that does not include subfolders
NameTypeDescription
filenamestringThe filename with subfolders
Since:
  • Version 1.3.2
Returns:
TypeDescription
stringThe filename without subfolders

Utils.hasEncryptedAudio()booleanstatic

Checks whether the audio files in the game are encrypted
Returns:
TypeDescription
booleanTrue if the audio files are encrypted

Utils.hasEncryptedImages()booleanstatic

Checks whether the image files in the game are encrypted
Returns:
TypeDescription
booleanTrue if the image files are encrypted

Utils.isAndroidChrome()booleanstatic

Checks whether the browser is Android Chrome
Returns:
TypeDescription
booleanTrue if the browser is Android Chrome

Utils.isLocal()booleanstatic

Checks whether the browser is accessing local files
Returns:
TypeDescription
booleanTrue if the browser is accessing local files

Utils.isMobileDevice()booleanstatic

Checks whether the platform is a mobile device
Returns:
TypeDescription
booleanTrue if the platform is a mobile device

Utils.isMobileSafari()booleanstatic

Checks whether the browser is Mobile Safari
Returns:
TypeDescription
booleanTrue if the browser is Mobile Safari

Utils.isNwjs()booleanstatic

Checks whether the platform is NW.js
Returns:
TypeDescription
booleanTrue if the platform is NW.js

Utils.isOptionValid(name)booleanstatic

Checks whether the option is in the query string
NameTypeDescription
namestringThe option name
Returns:
TypeDescription
booleanTrue if the option is in the query string

Utils.setEncryptionInfo(hasImages, hasAudio, key)static

Sets information related to encryption
NameTypeDescription
hasImagesbooleanWhether the image files are encrypted
hasAudiobooleanWhether the audio files are encrypted
keystringThe encryption key