Jump to content
This forum will be closing down. Please move to the respective dedicated project forums.

Question on renderCameraInfo


Mmarzex
 Share

Recommended Posts

So I am trying to call it in my render function within a state but for some reason it isn't being called or rendered. Is there anything you need to do other than call it from the render function?

 

My code where I'm trying to call it is as such

Main.Before = function(game) {	this.game = game;};Main.Before.prototype = {	player: Phaser.Sprite,	cursors: null,	create: function() {		//this.game.add.sprite(0, 0, 'sky');		this.player = this.game.add.sprite(0, this.game.world.centerY, 'player');		this.cursors = this.game.input.keyboard.createCursorKeys();	},	render: function() {		this.game.debug.renderCameraInfo(this.game.camera, 32, 32);		this.game.debug.renderSpriteInfo(this.player, 32, 100);	}}

And if it helps, here is my html just so you get an idea of my states

<!doctype html><html><head>  <meta charset="utf-8">  <title></title>  <!-- build:css main.min.css -->  <link rel="stylesheet" href="css/main.css">  <!-- /build -->  </head><body>  <div id="phaser-example"></div>  <!-- build:remove -->  <script src="http://localhost:35729/livereload.js"></script>    <!-- /build -->  <!-- build:js game.min.js -->  <script src="js/lib/phaser.js"></script>  <script src="js/boot.js"></script>  <script src="js/preloader.js"></script>  <script src="js/mainMenu.js"></script>  <script src="js/storyOne.js"></script>  <script src="js/before.js"></script>  <script src="js/game.js"></script>  <!-- /build -->  <script type="text/javascript">      function boot() {        var game = new Phaser.Game(800, 600);        game.state.add('boot', Main.Boot, true);        game.state.add('preloader', Main.Preloader);        game.state.add('menu', Main.MainMenu);        game.state.add('story_one', Main.StoryOne);        game.state.add('before', Main.Before);        game.state.add('game', Main.Game);      }      window.onload = function() {        boot();      }  </script>  </body></html>

Thanks!

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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