feat: updated engine version to 4.4-rc1
This commit is contained in:
parent
ee00efde1f
commit
21ba8e33af
5459 changed files with 1128836 additions and 198305 deletions
|
|
@ -5,7 +5,6 @@
|
|||
</brief_description>
|
||||
<description>
|
||||
JavaScriptObject is used to interact with JavaScript objects retrieved or created via [method JavaScriptBridge.get_interface], [method JavaScriptBridge.create_object], or [method JavaScriptBridge.create_callback].
|
||||
[b]Example:[/b]
|
||||
[codeblock]
|
||||
extends Node
|
||||
|
||||
|
|
@ -14,11 +13,13 @@
|
|||
|
||||
func _init():
|
||||
var buf = JavaScriptBridge.create_object("ArrayBuffer", 10) # new ArrayBuffer(10)
|
||||
print(buf) # prints [JavaScriptObject:OBJECT_ID]
|
||||
print(buf) # Prints [JavaScriptObject:OBJECT_ID]
|
||||
var uint8arr = JavaScriptBridge.create_object("Uint8Array", buf) # new Uint8Array(buf)
|
||||
uint8arr[1] = 255
|
||||
prints(uint8arr[1], uint8arr.byteLength) # prints 255 10
|
||||
console.log(uint8arr) # prints in browser console "Uint8Array(10) [ 0, 255, 0, 0, 0, 0, 0, 0, 0, 0 ]"
|
||||
prints(uint8arr[1], uint8arr.byteLength) # Prints "255 10"
|
||||
|
||||
# Prints "Uint8Array(10) [ 0, 255, 0, 0, 0, 0, 0, 0, 0, 0 ]" in the browser's console.
|
||||
console.log(uint8arr)
|
||||
|
||||
# Equivalent of JavaScriptBridge: Array.from(uint8arr).forEach(myCallback)
|
||||
JavaScriptBridge.get_interface("Array").from(uint8arr).forEach(_my_js_callback)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue