Why can’t the function be seen?
<!doctype html>
<html lang="en">
<head>
<script src="//cdn.jsdelivr.net/npm/phaser@3.11.0/dist/phaser.js"></script>
</head>
<body>
<script type="text/javascript">
var config = {
type: Phaser.AUTO,
width: 800,
height: 600,
scene: {
preload: preload,
create: create,
update: update
}
};
var game = new Phaser.Game(config);
function preload ()
{
}
function create ()
{
this.clickText = this.add.text(100,100, 'Click me')
this.clickText.setInteractive( {useHandCursor: true})
this.clickText.on('pointerdown', () => this.doSomething())
}
function doSomething()
{
console.log('did something!')
}
function update ()
{
}
</script>
</body>
</html>