Now I am trying put the SVG image on the canvas, however, when I launch my browser I don't see anything. Below is my code. I am new to HTML5 so please excuse any dumb mistakes.
index.htm
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Xcraft Engine: Test</title>
<script type="text/javascript" src="Engine/main.js"></script>
</head>
<body>
<canvas id="xCraftWindow" height="100%" width="100%">
</canvas>
</body>
</html>
main.js
//Main Javascript file created by Richard on Sunday January 20, 2013
window.onload = initialize()
function initialize() {
var xCraft = document.getElementById("xCraftWindow").getContext("2d");
var background = new Image;
background.onload = function() { xCraft.drawImage(img, 0, 0); };
background.src = "Images/titlescreen.svg";
}

New Topic/Question
Reply


MultiQuote




|