Created
September 11, 2012 22:07
-
-
Save kg/3702486 to your computer and use it in GitHub Desktop.
Basic JSIL HTML Template
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> | |
<head> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
</head> | |
<body onload="onLoad()"> | |
<script type="text/javascript"> | |
var jsilConfig = { | |
printStackTrace: false, | |
xna: 4, | |
manifests: [ | |
"YOUR APPLICATION NAME.exe", | |
"Content/YOUR APPLICATION NAME.contentproj" | |
], | |
}; | |
</script> | |
<script src="../Libraries/JSIL.js" type="text/javascript"></script> | |
<canvas id="canvas" width="1280" height="720"> | |
</canvas><br> | |
<div id="log"></div> | |
<script type="text/javascript"> | |
function runMain () { | |
// We can't invoke Main() since it disposes the Game immediately, breaking everything. | |
var asm = JSIL.GetAssembly("YOUR APPLICATION NAME", true); | |
var game = new asm.YOURNAMESPACE.YOURGAME(); | |
game.Run(); | |
}; | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I created an index.html page in the same directory as the JSIL produced .js files using the index.html above (substituting for , and also putting my application name in where appropriate. I then copied the Library directory to the same directory as the index.html and JSIL produced .js file. I also changed <script src="../Libraries/JSIL.js" type="text/javascript"></script> to <script src="Libraries/JSIL.js" type="text/javascript"></script>.
When I load the index.html with Internet explorer (so I can use the built in debugger), I get "Object doesn't support property or method 'GetAssembly' when it tries to run the line
var $asm00 = JSIL.GetAssembly("memulator, Version=1.2.0.4, Culture=neutral, PublicKeyToken=null");
from manifest.js file to load the first Assembly.
Does anyone have a gist that actually was tested and works?