Egretia Engine: Development procedure for accessing the Xiaomi Quick Games

Image for post

1.Environment Configuration

>Egretia Launcher V1.0.62 or above

>Egretia Engine V5.2.17 or above

>Install npm

2. The game creation

1)After the creation via Egretia Launcher, the project will be shown on the list. Then developers can click the release settings

Image for post

2) Select the Xiaomi Quick Game to create the game

Image for post

3) After the creation, developers can click the button to release the game

Image for post

a. Compile the game code to Xiaomi Quick Game: to execute command egret build — target qgame and compile the code in the Egretia project into the Quick Game project;

b. QR code: to install rpk by scanning the QR code on the Xiaomi Quick Game Debugger

c. Release: to execute the command npm run build and build rpk package

d. Debugging: use the USB cable to connect your computer to the Xiaomi device and click the debug button then the debugging interface will start automatically in Chrome

3. Publish to Xiaomi Quick Game by the command line

Method 1: Developers can use the command line to build and release Xiaomi Quick Game

>debug: egretia build — target qgame;

>release: egretia publish — target qgame

Method 2: Deploy the template: egretProperties.json

Image for post

As it shows, developers can execute the command line egretia build or egretia publish to build and release Xiaomi Quick Game when property current is set to qgame in the configuration files of egretProperties.json

4. Package and release Xiaomi Quick Game by the command line

1)Execute the command line npm run build and generate a dist file. The file com.application.demo.debug.rpk is the Quick Game Project file, which can be debugged on the devices.

2) Generate the Quick Game to be released by executing the command line

npm run release

3) Listed below is the Quick Game structure

Image for post

4) An overview of directory structure:

egret.qgame.js: Adaptation layer code of Egretia engine and Quick Game;

js folder: js code of the game;

library:the code of local cache of running Xiaomi Quick Game by Assetsmanager can be deleted;

main.js:the entry file of Quick Game;

manifest.js: to load all js codes;

manifest.json: the configuration file of Quick Game

resources: resource files such as pictures and audio of the game

5) manifest.json

Image for post

6) Parameter:

Package: the name of package;

Name: Application name, within 6 Chinese characters, consistent with the name saved in the application store, used to display the application name on desktop icons, pop-up windows, etc.;

versionName: the application version;

versionCode: The application version number, which is incremented from 1. It is recommended to add 1 to the current version every time the package is re-uploaded;

minPlatformVersion: The minimum supported platform version number (1041), for compatibility check, can avoid the incompatibility caused by running on low version platforms after going online; if not filled in, it will be processed according to the internal test version;

icon: The path of the application icon, the size is 192×192;

orientation: the Supported screen orientation. Portrait is vertical screen, and landscape is horizontal screen. This parameter will be automatically obtained from index.html of the Egretia game project.

4. Debugging

Note: The debugging must be based on the physical device.

1) Install Xiaomi Quick Game Debugger and Xiaomi Quick Game Environment

2) Use a USB cable to connect your computer to your Xiaomi device and copy the generated quick game rpk file to the devices

3) Open the Xiaomi Quick Game Debugger, choose (com.miui.hybrid) and click Local Install, then select the uploaded rpk files to run the game

4) Input chrome://inspect/#devices on the Chrome browser and click Enter to generate com.miui.hybrid. the debugging information will pop out on the screen

Stay tuned for updates from the Egretia official channels below so that you can be involved in all the exciting things to come!

Egretia Telegram:

Egretia Twitter

Egretia Website: