phoboslab / Ejecta

A Fast, Open Source JavaScript, Canvas & Audio Implementation for iOS
2.81k stars 322 forks source link

background image in main.js does not show in latest Ejecta version #680

Closed boris342 closed 3 years ago

boris342 commented 3 years ago

I have problem with latest version of Ejecta. I have upgraded ejecta from version posted on impactjs website to latest version posted on GitHub but background image in main.js does not show. But this problem is only in main.js when I change screen by ig.system.setGame it show background correctly. It worked well with older version of Ejecta.

clearColor: null,
background: new ig.Image('media/levels/main_menu_320_568_latest_version1.png'),

and in draw function

var background_d = this.background.data;
ig.system.context.drawImage(background_d, this.x, 0, ig.system.width, ig.system.height);
...
...
this.parent();

I do it the same way on other places and it show background correctly. Problem is only in main.js and with latest version of Ejecta.