Jump to content

Placement problem for game


Gritwork
 Share

Recommended Posts

When setting up my index.html file for my game I come across a problem where there's a huge gap of space between the top of the page and where my html5 game is loaded onto the screen. I have no idea of why this is. Another problem is, the viewing size is right but, it's like the whole game is zoomed in. Instead of showing the whole game room it's supposed to it's just zoomed in to one area of it.

<!doctype html> <html lang="en"> <head> 	<meta charset="UTF-8" />	<title>Simian Scamper</title>		<script type="text/javascript" src="js/phaser.min.js"></script>	<script type="text/javascript" src="js/Boot.js"></script>	<script type="text/javascript" src="js/Preload.js"></script>	<script type="text/javascript" src="js/MainMenu.js"></script>	<script type="text/javascript" src="js/Game.js"></script>	</head>	<body>		<body bgcolor="#000">		<!-- INCLUDE THE MAIN GAME FILE -->		<script src="js/main.js"></script>					<div id="ssMain"></div>	</body></html>

What's the issue with my code? I want it to just start at the very top and be regular sized. Just on another note so I can have one topic. How do I create functions to call during certain events? I don't know where to place the code for it.

Link to comment
Share on other sites

In your <head> tags try adding in this:

<style>body {    padding: 0;    margin: 0;}</style>

This will set all the margins and paddings to 0.

Right on. This did it perfectly. I also figured out the whole issue with functions in the mean time. Thanks for the help.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...