Frage

Is there a way to override parts of an OpenFL-Template without modifying the installed version? Specifically I want to modify templates/android/src/org/haxe/nme/GameActivity.java.

I'm aware of examples that override AndroidManifest.xml via:

<template
    path="templates/android/AndroidManifest.xml"
    rename="AndroidManifest.xml"
    if="android"
/>

This works fine, but not for the desired Java-File.

I also tried to make a copy of the templates-Folder and put <template path="templates" /> in my project.xml-File, as described in the docs. (I even tried <templates` path="templates" /> because I think the docs are wrong.) Didn't work.

My custom GameActivity.java is ignored. Is there a way?

(I'm using Haxe 3.1.0-rc3, OpenFL 1.0.6 with OpenFL-native 1.0.7.)

War es hilfreich?

Lösung

You should override MainActivity.java (like you do for AndroidManifiest.xml). MainActivity extends GameActivity and you can override some parts. Or write your own 'GameActivity'.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top