i embed the game with iframe .how can i call the game function “settext” from outside.
settext(stringtext){
this.label.string = stringtext;
}
I did this code but it doesn’t work…
thank everyone
i embed the game with iframe .how can i call the game function “settext” from outside.
settext(stringtext){
this.label.string = stringtext;
}
You need to register a listener inside the game to get the message -
window.addEventListener("message", function (e) {
const command = e.data;
//...
}
That’s correct, you will have to do something like this:
[Accessing the HTML5 game from outside. - #4 by vkgamedev](Code Snippet)
it worked, thank you very much
yeah,thank youuuu
This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.