Last active
November 3, 2015 23:35
-
-
Save fizzvr/6c1daf4b2e5f1b94c86b to your computer and use it in GitHub Desktop.
1f3-1.5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="es"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>1f3</title> | |
<style> | |
body { | |
background: #f8f8f8; | |
font-family: serif; | |
font-size: 20px; | |
} | |
#game { | |
display: block; | |
width: 400px; | |
height: 400px; | |
border: 1px solid #ddd; | |
margin: 10% auto 0 auto; | |
} | |
</style> | |
<script src="https://code.createjs.com/createjs-2015.05.21.min.js"></script> | |
<script type="text/javascript"> | |
var stage; | |
function init() { | |
var saludo; | |
var dimensiones; | |
stage = new createjs.Stage('gameCanvas'); | |
saludo = new createjs.Text("Hola Mundo 20px Arial Black", "20px Arial", "black"); | |
saludo.textBaseline = "alphabetic"; | |
dimensiones = saludo.getBounds(); | |
saludo.x = stage.canvas.width/2 - dimensiones.width/2; | |
saludo.y = stage.canvas.height/2 - dimensiones.height/2; | |
saludo.addEventListener("click", onBallClicked); | |
stage.addChild(saludo); | |
stage.update(); | |
} | |
function onBallClicked(event) | |
{ | |
console.log('Mensaje en Consola'); | |
} | |
</script> | |
</head> | |
<body onload="init()"> | |
<div id="game"> | |
<canvas id="gameCanvas" width="400px" height="400px"> | |
Contenido Alternativo sin soporte para canvas. | |
</canvas> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment