June 23, 2017, 03:30:26 AM

Author Topic: First frame of scene has 0 layers  (Read 189 times)

POW2011

  • Newbie
  • *
  • Posts: 3
    • View Profile
First frame of scene has 0 layers
« on: March 06, 2017, 03:10:02 PM »
Hello world,

I noticed that when you switch scene (HXP.scene = new YourScene()) There is a "flash" where you see just the background colour for one frame. And then the scene renders. If you add this trace:

trace(_layerList.length);

To Scene.hx render() function line 160, then when you change scene you can see that there are 0 layers for the first frame.

This flashing gets annoying when your game has multiple little levels.

Not quite sure what the best fix for this will be... Trying not to render a frame if the layers are 0.

bendmorris

  • Global Moderator
  • Jr. Member
  • *****
  • Posts: 84
    • View Profile
Re: First frame of scene has 0 layers
« Reply #1 on: March 11, 2017, 12:27:44 PM »
Thanks for reporting. I opened an issue on github: https://github.com/HaxePunk/HaxePunk/issues/446