hi
i have a background image and i have an image falling from top to down (lets say a rectangle) is it possible to give a depth feeling ? maybe draw some king of shadows ?
hi
i have a background image and i have an image falling from top to down (lets say a rectangle) is it possible to give a depth feeling ? maybe draw some king of shadows ?
Definitely. You could duplicate the image, set the tint to black and offset it to give it a drop-shadow effect.
@Jake.Caron do you have an example, tried to create the tint over a spritesheet but it doesnt really do the affect or maybe i did something incorrect.
Sure. Paste this:
var config = {
backgroundColor: '#2d2d2d',
parent: 'phaser-example',
scene: {
preload: preload,
create: create,
}
}
var game = new Phaser.Game(config);
var imageContainer;
function preload (){ this.load.image('bunny', 'assets/sprites/bunny.png');}
function create ()
{
imageContainer = this.add.container(350, 300);
let dropShadow = this.add.image(5, 5, 'bunny').setScale(.5).setTint(0x000000).setAlpha(.5);
let image = this.add.image(0, 0, 'bunny').setScale(.5);
imageContainer.add([dropShadow, image]);
}