Jump to content

Search the Community

Showing results for tags 'setTexture'.

  • 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 4 results

  1. I modified the tween loop examples in v3. I'd like to change the texture when every tween loop finished. But the texture flickers after setTexture(). Am I doing anything wrong? var config = { type: Phaser.WEBGL, width: 800, height: 600, backgroundColor: '#2d2d2d', parent: 'phaser-example', scene: { preload: preload, create: create } }; var game = new Phaser.Game(config); function preload () { this.load.image('block', 'assets/sprites/block.png'); this.load.image('arrow', 'assets/sprites/arrow.png'); } var name = ['block', 'arrow']; var i=0; function create () { var marker = this.add.image(100, 300, 'block').setAlpha(0.3); var image = this.add.image(100, 300, 'block'); this.tweens.add({ targets: image, x: 300, duration: 1000, repeat: -1, onRepeat: function(tween, target){ target.setTexture(name[++i%2]); } }); }
  2. In the invaders game example, when an invader is killed, an explosion sprite takes its place. There are 30 invaders and 30 explosions in 2 groups. Is this the optimal way to do explosions, or will something like .setTexture() (haven't used it yet) do a better job? alien.kill(); var explosion = explosions.getFirstExists(false); explosion.reset(alien.body.x, alien.body.y); explosion.play('kaboom', 30, false, true); The alien sprite is killed and an explosion one replaces it, until the animation plays. Is this the best way to handle explosions for resource limited devices?
  3. Hi, I have 5 sprites and i want to play an animation on its sprite. this is the test Page : http://goldgames.eu/test.html I have this problem only on google chrome. when i am setting texture to sprite[0] and sprite[1] its ok but when i am setting texture to sprite[2] the browser lags. what i am doing wrong ? sorry for my english, its not very good
  4. I am loading individual texture images using "new PIXI.AssetLoader" Then later when a user clicks on an image i am changing the image using: " var textureName = PIXI.Texture.fromImage ('images/img.png']); this.setTexture(textureName); " However the "preloaded" image isn't always displaying, and needs to load again... Am I doing something wrong? Thanks
×
×
  • Create New...