Haxe doesn't know anything about Rune since you haven't created any Haxe externs for it. Perhaps try wrapping "Rune" inside "
js.Syntax.code" to directly access it in the generated Javascript code instead.
js.Syntax API docsjs.Syntax.code("Rune").init({
resumeGame: myResumeGameFunction,
pauseGame: myPauseGameFunction,
restartGame: myRestartGameFunction,
getScore: myGetScoreFunction
});
I'm not positive that that will work, just the first thing I might try.
I took a quick look at the
Rune SDK (linked for myself and others), and it says you need to load some javascript before anything else:
<script src="https://cdn.jsdelivr.net/npm/rune-games-sdk@2.5.0/dist/browser.min.js"></script>
You may be able to get away with adding that as a
dependency in
Settings > Advanced > OpenFL Settings.
<section if="html5">
<dependency name="https://cdn.jsdelivr.net/npm/rune-games-sdk@2.5.0/dist/browser.min.js" />
</section>
Otherwise, you may need to create an engine extension with a modified index.html template.
Here's an example of an almost blank HTML5 engine extension with an index.html template set up.
You may find it helpful to browse other HTML5 engine extensions that handle integration with different javascript SDKs, so here are a couple that I wrote:
-
GameDistribution-
CrazyGames