Jump to content

Search the Community

Showing results for tags 'async loader'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Standards
    • Coding and Game Design
    • Paid Promotion (Buy Banner)
  • Frameworks
    • Pixi.js
    • Phaser 3
    • Phaser 2
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
    • GameMonetize
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered
    • Marketplace (Sell Apps, Websites, Games)

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Twitter


Skype


Location


Interests

Found 1 result

  1. Hello, I cannot manage to make Phaser continue updating stage while I am doing something in background. In particular, I noticed that to generate stage I need 2-4 seconds (resources are loaded but generation itself takes this time). So I decided to add loading by default withing create() method and call actual stage creation asynchronously by calling it in setTimeout(function() {}, 0). However, Phaser freezes tween animation: var sprite = this.add.sprite(100, 100, 'loading'); this.game.add.tween(sprite.scale).to({x: 1.5, y: 1.5}, 500, Phaser.Easing.Linear.None, true, 0, -1, true); setTimeout(function(that) { var time_now = (new Date()).getTime(); while ((new Date()).getTime() - time_now < 2000) {} sprite.visible = false; }, 0, this); I attached two short files, one is with while loop (to simulate some work) and dot is not animating, the second one is without while loop and visible = false statement var sprite = this.add.sprite(100, 100, 'loading'); this.game.add.tween(sprite.scale).to({x: 1.5, y: 1.5}, 500, Phaser.Easing.Linear.None, true, 0, -1, true); setTimeout(function(that) { var time_now = (new Date()).getTime(); // while ((new Date()).getTime() - time_now < 2000) {} // sprite.visible = false; }, 0, this); If that's not a way to do what I want to do then how can I show animation while I am preparing stage?
×
×
  • Create New...