Sign in to follow this  
ZoomBox

How to tint a particle

Recommended Posts

A particle is a type of sprite, and an emitter is a type of group, so if you can find the particle you want to tint in the emitter using the normal methods you can just call .tint on it as normal. Something like this will tint all the particles in the emitter:

emitter.forEach(function(particle) {  // tint every particle red  particle.tint = 0xff0000;});

See the Emitter documentation for more.

Share this post


Link to post
Share on other sites
Phaser.Particle = function (game, x, y, key, frame) {    Phaser.Sprite.call(this, game, x, y, key, frame);

http://docs.phaser.io/Particle.js.html#sunlight-1-line-20

 

Particle extends Sprite (which itself inherits from pixi's Sprite, and so on) so it inherits all of Sprite's properties. 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.