Andrzej Mazur / @end3r / Enclave Games
Gdańsk, October 19th 2013
Andrzej Mazur (coding, Enclave Games)
Robert Podgórski (graphics, Blackmoon Design)
Geeksphone Keon and Peak, ZTE Open, Alcatel OneTouch Fire, LG Leo, more coming soon.
Firefox OS App Manager (Firefox 26+), Dev tools + Simulator
[firefox ap == the web, so advices re for html5 games, not firefox os games]
ctx.drawImage(myImage, 0.3, 0.5);
myEntity.offscreenCanvas = document.createElement(“canvas”);
myEntity.offscreenCanvas.width = myEntity.width;
myEntity.offscreenCanvas.height = myEntity.height;
myEntity.offscreenContext = myEntity.offscreenCanvas.getContext(“2d”);
myEntity.render(myEntity.offscreenContext);
<canvas id="mycanvas" moz-opaque></canvas>
var scaleX = canvas.width / window.innerWidth;
var scaleY = canvas.height / window.innerHeight;
var scaleToFit = Math.min(scaleX, scaleY);
var scaleToCover = Math.max(scaleX, scaleY);
stage.style.transformOrigin = "0 0"; //scale from top left
stage.style.transform = "scale(" + scaleToFit + ")";
Optimize for HTML5 games, not Firefox OS
manifest.webapp
{
"name": "My App",
"description": "My description goes here",
"launch_path": "/",
"icons": {
"128": "/img/icon-128.png"
},
"developer": {
"name": "Your name or organization",
"url": "http://your-homepage-here.org"
},
"default_locale": "en"
}