-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds More Documentation and Change Formatting
- Loading branch information
Showing
6 changed files
with
230 additions
and
142 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# WasmFile | ||
|
||
_Defined in: [WasmFile.gd](../out/addons/godot_wasm/WasmFile.gd)_ | ||
|
||
_Inherits: [PackedDataContainer](https://docs.godotengine.org/en/stable/classes/class_packeddatacontainer.html)_ | ||
|
||
This class (along with WasmFileHelper) helps importing WASM and WAT file into Godot. | ||
|
||
## Properties | ||
|
||
### `String name` | ||
|
||
The name of the module. Is exported and editable. | ||
|
||
### `Dictionary imports` | ||
|
||
Imports for this module. Values are also `WasmFile` objects. | ||
|
||
## Methods | ||
|
||
### `WasmModule get_module()` | ||
|
||
Gets the compiled module. | ||
Module object is cached, so calling this twice will yield the same object. | ||
|
||
### `WasmInstance instantiate(Dictionary host = {}, Dictionary config = {})` | ||
|
||
Creates a new instance from the module. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# WasmHelper | ||
|
||
_Defined in: [WasmHelper.gd](../out/addons/godot_wasm/WasmHelper.gd)_ | ||
|
||
The script contains helper constants and functions for using the addon. | ||
|
||
## Constants | ||
|
||
```gdscript | ||
const TYPE_I32 = 1 | ||
const TYPE_I64 = 2 | ||
const TYPE_F32 = 3 | ||
const TYPE_F64 = 4 | ||
const TYPE_VARIANT = 6 | ||
``` | ||
|
||
## Static Functions | ||
|
||
### `WasmModule load_wasm(String name, Variant data, Dictionary imports = {})` | ||
|
||
Loads a new Webassembly module. Returns `null` if it fails. | ||
|
||
### `WasmModule load_wasm_file(String name, String path, Dictionary imports = {})` | ||
|
||
Loads a new Webassembly module from file. | ||
Path can be a Godot-specific path or global path. Returns `null` if it fails. |
Oops, something went wrong.