CreateJS game stop before load assets (Android - Cloud Build Service)
i made crossword game using createjs (https://code.createjs.com/createjs-2015.11.26.min.js ) works on web browsers. see here.
in game have drag , drop letters spaces form words.
now i'm using phonegap clould service make android builds. version 3.7.0 of cordova worked in moto g android 5.1. when tryied update version "cli-6.3.0" game showed odd behaviour. game open stops before preloading assets. can see background.
using alerts in code realize game stop before instantiating stage:
stage = new createjs.stage(canvas);
but don't know if problem.
this piece of js code:
var canvas, stage, exportroot;
function init()
{
canvas = document.getelementbyid("canvas");
// alert(0);
alert("canvas: " + canvas);
stage = new createjs.stage(canvas);
// alert(1);
stage.enablemouseover(30);
createjs.ticker.setfps(60);
createjs.ticker.addeventlistener("tick", tick);
wide = window.innerwidth > common.limithorizontal;
onresize();
preloader = new preloader(manifest);
preloader.initialize();
}
<body onload="init();" style="margin:0px;">
<canvas id="canvas" width="960" height="550"></canvas>
</body>
my project on github: github - marcoscardosomartins/cruzadinhas.
tests in moto g - android 5.1
no plugins used.
my project structure this:
root folder
www
audio
core
css
icons
images
src
index.html
main.js
cruzadinhas.js
config.xml
<?xml version="1.0" encoding="utf-8"?>
<widget xmlns = "http://www.w3.org/ns/widgets"
xmlns:gap = "http://phonegap.com/ns/1.0"
id = "br.com.noas.cruzadinhas"
version = "1.0.2">
<name>cruzadinhas</name>
<description>
complete cruzadinhas de acordo com o nome das imagens.
</description>
<author href="http://www.noas.com.br" email="marcos@noas.com.br">
noas team
</author>
<gap:platform name="android" />
<preference name="permissions" value="none"/>
<preference name="orientation" value="landscape" /> <!-- all: default means both landscape , portrait enabled -->
<preference name="target-device" value="universal" /> <!-- all: possible values handset, tablet, or universal -->
<preference name="fullscreen" value="true" /> <!-- all: hides status bar @ top of screen -->
<preference name="splash-screen-duration" value="10000"/> <!-- android -->
<preference name="android-minsdkversion" value="7" /> <!-- android: min sdk version supported on target device. max version blank default. -->
<preference name="android-installlocation" value="auto" /> <!-- android: app install location. 'auto' choose. 'internalonly' device memory. 'preferexternal' sdcard. -->
<preference name="keeprunning" value="true"/>
<icon src="www/images/icone.fw.png" />
<icon src="www/icons/icon-36-ldpi.png" platform="android" density="ldpi" />
<icon src="www/icons/icon-48-mdpi.png" platform="android" density="mdpi" />
<icon src="www/icons/icon-72-hdpi.png" platform="android" density="hdpi" />
<icon src="www/icons/icon-96-xhdpi.png" platform="android" density="xhdpi" />
<gap:splash src="www/icons/splash-ldpi.png" gap:platform="android" gap:density="ldpi" />
<gap:splash src="www/icons/splash-mdpi.png" gap:platform="android" gap:density="mdpi" />
<gap:splash src="www/icons/splash-hdpi.png" gap:platform="android" gap:density="hdpi" />
<gap:splash src="www/icons/splash-xhdpi.png" gap:platform="android" gap:density="xhdpi" />
<access origin="*"/>
<allow-intent href="https://*/*"/>
<allow-navigation href="https://*/*"/>
</widget>
my question is: why game stops after open?
thanks in advance.
i assume referencing createjs library remotely , not local app? if so, guessing have whitelist issue in app. please see cordova-plugin-whitelist - apache cordova docs learn more this. change earlier version of phonegap.
chris
More discussions in PhoneGap
adobe
Comments
Post a Comment