Engine Does not start when using loader

62 views
Skip to first unread message

igloo15

unread,
May 21, 2019, 12:30:14 AM5/21/19
to excaliburjs
I am building out a small game using excaliburjs and have found that using the loader causes my engine to never start. If I don't use a loader my textures just fail to load due to naturalWidth being undefined. I am not really sure what I am doing wrong. When I used the loader it showed no error just never completed the load. In dev tools I can see all the textures finishing loading so its not as if loader is waiting on loading textures. I believe it is silently failing potentially with same issue I am seeing when not using loader. 


This is the line of code in my game where I am using the loader. I don't see any particular issues but it just does not seem to like what I am doing. Does anyone have any thoughts?

Thanks

Kamran Ayub

unread,
May 21, 2019, 7:43:04 AM5/21/19
to igloo15, excaliburjs
What happens if you don't extend Engine? I've actually never tried to extend it (though that's a neat idea). Typically we create a wrapper game class that creates a new engine instance directly.

--
You received this message because you are subscribed to the Google Groups "excaliburjs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to excaliburjs...@googlegroups.com.
To post to this group, send email to excal...@googlegroups.com.
Visit this group at https://groups.google.com/group/excaliburjs.
To view this discussion on the web visit https://groups.google.com/d/msgid/excaliburjs/d300f584-8d9b-4809-8db8-f3ba172feefa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

igloo15

unread,
May 21, 2019, 9:56:41 PM5/21/19
to excaliburjs
I reworked it so that I am not extending engine but still have same issue


On Tuesday, May 21, 2019 at 7:43:04 AM UTC-4, Kamran Ayub wrote:
What happens if you don't extend Engine? I've actually never tried to extend it (though that's a neat idea). Typically we create a wrapper game class that creates a new engine instance directly.

On Mon, May 20, 2019, 11:30 PM igloo15 <mtoll...@gmail.com> wrote:
I am building out a small game using excaliburjs and have found that using the loader causes my engine to never start. If I don't use a loader my textures just fail to load due to naturalWidth being undefined. I am not really sure what I am doing wrong. When I used the loader it showed no error just never completed the load. In dev tools I can see all the textures finishing loading so its not as if loader is waiting on loading textures. I believe it is silently failing potentially with same issue I am seeing when not using loader. 


This is the line of code in my game where I am using the loader. I don't see any particular issues but it just does not seem to like what I am doing. Does anyone have any thoughts?

Thanks

--
You received this message because you are subscribed to the Google Groups "excaliburjs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to excal...@googlegroups.com.

Kamran Ayub

unread,
May 22, 2019, 5:13:14 PM5/22/19
to igloo15, excaliburjs
Are you able to reproduce in a code pen? Otherwise we can try cloning and debugging to see what it might be. The code seems okay on the surface!

To unsubscribe from this group and stop receiving emails from it, send an email to excaliburjs...@googlegroups.com.

To post to this group, send email to excal...@googlegroups.com.
Visit this group at https://groups.google.com/group/excaliburjs.

igloo15

unread,
May 22, 2019, 6:39:45 PM5/22/19
to excaliburjs
I will try to reproduce in a code pen but my particular issue is related to loading textures/pngs. I was able to get things working if I just don't load the textures. I am not sure that CodePen would be able to properly show my issue related to textures but I will see if I can do a repro. 


On Wednesday, May 22, 2019 at 5:13:14 PM UTC-4, Kamran Ayub wrote:
Are you able to reproduce in a code pen? Otherwise we can try cloning and debugging to see what it might be. The code seems okay on the surface!

On Tue, May 21, 2019, 8:56 PM igloo15 <mtoll...@gmail.com> wrote:
I reworked it so that I am not extending engine but still have same issue

On Tuesday, May 21, 2019 at 7:43:04 AM UTC-4, Kamran Ayub wrote:
What happens if you don't extend Engine? I've actually never tried to extend it (though that's a neat idea). Typically we create a wrapper game class that creates a new engine instance directly.

On Mon, May 20, 2019, 11:30 PM igloo15 <mtoll...@gmail.com> wrote:
I am building out a small game using excaliburjs and have found that using the loader causes my engine to never start. If I don't use a loader my textures just fail to load due to naturalWidth being undefined. I am not really sure what I am doing wrong. When I used the loader it showed no error just never completed the load. In dev tools I can see all the textures finishing loading so its not as if loader is waiting on loading textures. I believe it is silently failing potentially with same issue I am seeing when not using loader. 


This is the line of code in my game where I am using the loader. I don't see any particular issues but it just does not seem to like what I am doing. Does anyone have any thoughts?

Thanks

--
You received this message because you are subscribed to the Google Groups "excaliburjs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to excal...@googlegroups.com.
To post to this group, send email to excal...@googlegroups.com.
Visit this group at https://groups.google.com/group/excaliburjs.
To view this discussion on the web visit https://groups.google.com/d/msgid/excaliburjs/d300f584-8d9b-4809-8db8-f3ba172feefa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "excaliburjs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to excal...@googlegroups.com.
To post to this group, send email to excal...@googlegroups.com.
Visit this group at https://groups.google.com/group/excaliburjs.

Erik Onarheim

unread,
May 22, 2019, 9:24:34 PM5/22/19
to excaliburjs
Hi igloo15,

I pulled the project down locally looks like the play button is being hidden by the angular app container.

2 work arounds right now, suppress the play button (this may have an effect on audio in chrome, they mute sound if there has been no user interaction). The button will not block progression into the game

export class DungeonGame {
dungeonService: DungeonService;
engine: Engine;

constructor(dungeonService: DungeonService) {
this.engine = new Engine({
canvasElementId: 'game',
displayMode: DisplayMode.Container,
pointerScope: Input.PointerScope.Canvas,
suppressPlayButton: true
});
this.engine.isDebug = false;
this.dungeonService = dungeonService;
}


Or in styles.scss add a rule for #excalibur-play to be on top

#excalibur-play {
z-index: 999;
}



dungeongame.PNG



dungeongame2.PNG



I've opened a bug in core excalibur to address play button visibility, we should be able to include it in the next release in 2 weeks. https://github.com/excaliburjs/Excalibur/issues/1152

Thanks for posting, let us know if you have any more questions.

Cheers,
Erik

igloo15

unread,
May 22, 2019, 9:45:19 PM5/22/19
to excaliburjs
Thanks I thought it had to be something strange like that 
Reply all
Reply to author
Forward
0 new messages