58be256f8a
continuous-integration/drone/push Build is passing
Details
|
||
---|---|---|
.drone.yml | ||
.gitignore | ||
Game.gd | ||
Game.tscn | ||
LICENSE | ||
README.md | ||
default_env.tres | ||
export_presets.cfg | ||
fixed-size.html | ||
icon.png | ||
icon.png.import | ||
kenpixel_future.ttf | ||
project.godot |
README.md
godot-html-js-int-demo
Demo of integrating a Godot HTML5 exported game with its host page.
Uses a simple clicker game and a custom web shell to interact with the hosted page.
Setup
- Requires Godot 3.2.x
- Use OpenGL ES 2.0 to allow for the HTML5 export.
The custom JS and styling (outside of the fixed size template provided by the
Godot devs) can be found between the <!-- Start of Custom Game block -->
and
<!-- End of Custom Game block -->
comment codes in fixed-size.html.
Extra Notes
- Calling JS from the HTML5 Export
- Using a Custom HTML Shell
- Custom Fixed Size Shell template
- Some minor tweaks are needed to work the custom shell with Godot 3.2:
- Remove the line:
const EXTRA_ARGS = JSON.parse('$GODOT_ARGS');
- Update the starting of game engine by removing
EXTRA_ARGS
fromengine.startGame(EXECUTABLE_NAME, MAIN_PACK, EXTRA_ARGS).then(() => {
making it `engine.startGame(EXECUTABLE_NAME, MAIN_PACK).then(() => {
- Remove the line: