New Canvas Html

0 favourites
  • 3 posts
From the Asset Store
Pixel Destruction like in "Worms" (Drawing Canvas based)
  • Made a more good-looking html for the game canvas. It features auto-positioning of the canvas in center of screen with some jQuery. Could be useful

    <!DOCTYPE html>
    	<title>New project</title>
        <meta charset="UTF-8" />
    	<style type="text/css">
    		canvas { border: 1px solid black; }
    			background: #000;
    			background: #616161;
    			border: 1px solid #8F8F8F;
    			padding: 15px;
    			-moz-border-radius: 10px;
    			-webkit-border-radius: 10px;
    			border-radius: 10px;
    			font-family: "arial";
    			font-size: 12px;
    			text-align: center;
    			background: #818181;
    			color: #fff;
    			padding: 1em;
    	<script type="text/javascript" src="jquery-1.4.4.min.js"></script>
    	<script type="text/javascript" src="c2runtime.js"></script>
        <script type="text/javascript">
    		$(document).ready(function ()
                var project = new cr.runtime(document.getElementById("c2canvas"));
    	<script id="pinCanvasOnCenterScreenScript" type="text/javascript">
    		function pinCanvasOnCenter()
    				position: 'absolute',
    				left: ($(window).width() - $('#canvasBox').outerWidth()) / 2,
    				top:  ($(window).height() - $('#canvasBox').outerHeight()) / 2
    	<div id="canvasBox">
    		<canvas id="c2canvas" width="640" height="480">
    			<div id="canvasNotSupportedBox">
    				Sorry, your browser doesn't support Canvas!<br/>
    				Please try with:
    				<a href="">Chrome 9+</a> 
    				<a href="">Firefox 4+</a> 
    				<a href="">Safari 10.6+</a>
  • Hey, that's not bad (although it needs the preview scripts included to work as the preview HTML). Mind if we add something like this to the next build?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Of course not

    It'll look awesome with Construct logo below

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)