Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

10 years ago by nurdin

I already set my background image but it doesn't appear on my start page.

backgroundImage: new ig.Image( 'media/start-bg.png' ),
	
	init: function() {
		// Initialize your game here; bind keys etc.
	},
	
	update: function() {
		// Update all entities and backgroundMaps
		this.parent();
		
		// Add your own, additional update code here
	},
	
	draw: function() {
		// Draw all entities and backgroundMaps
		this.backgroundImage.draw(0,0);
		
		this.parent();
		
		
	}

No error inside my console. Please advice. Thank you.

10 years ago by nurdin

I already found the solution,

this.backgroundImage.draw(0,0); 

must be after

this.parent();

draw: function() {
		// Draw all entities and backgroundMaps
		
		
		this.parent();
		this.backgroundImage.draw(0,0);
		
	}

Problem solved!!
Page 1 of 1
« first « previous next › last »