I need a red highlight to appear when the mouse is hovered over an object, and the highlight to disappear when the mouse is removed.Example below:
How to do this, here is the code?
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<title>Glow</title>
</head>
<body>
<script src="//cdn.jsdelivr.net/npm/phaser@3.55.2/dist/phaser.js"></script>
<script>
var config = {
type: Phaser.AUTO,
width: 800,
height: 600,
backgroundColor: '#2d2d2d',
parent: 'phaser-example',
scene: {
preload: preload,
create: create
} };
var game = new Phaser.Game(config);
var tween = null;
var tweenAlive = false;
function preload()
{
this.load.baseURL = './assets/';
this.load.image('meteorit', 'sprites/meteorit.png');
}
function create()
{
var sprite = this.add.sprite(300, 300, 'meteorit');
sprite.setInteractive();
sprite.on('pointerover', ()=>{
console.log("glow");
})
sprite.on('pointerout', ()=>{
console.log("delete glow");
})
}
</script>
</body>
</html>