1 decade ago by fulvio
This plugin allows you to set the transparency for background colours of images, tilesets, etc that are not originally transparent.
var img = new ig.Image( 'player.png' );
to:
If you want to set the player background to transparent.
The reason I use hash tags to specify the colour, is because:
- Your browser cache WILL be used to load the image again each time, which is good. We don't want to re-download the image every time there is a new background color.
- The ImpactJS cache will NOT be used between different background colors, which is also good (we don't want each background color to modify the same underlying image). The cache will only be used when referring to the same backgrounds (since the path will match, of course).
Link: Transparent Backgrounds
Note: This is based off the image blender code by Ptg:
Image Blender
var img = new ig.Image( 'player.png' );
to:
var img = new ig.Image( 'player.png#alpha:ff00ff' );
If you want to set the player background to transparent.
The reason I use hash tags to specify the colour, is because:
- Your browser cache WILL be used to load the image again each time, which is good. We don't want to re-download the image every time there is a new background color.
- The ImpactJS cache will NOT be used between different background colors, which is also good (we don't want each background color to modify the same underlying image). The cache will only be used when referring to the same backgrounds (since the path will match, of course).
Link: Transparent Backgrounds
Note: This is based off the image blender code by Ptg:
Image Blender