Hey, I need help from somebody who know tink.js.
I'm making a small game in pixi.js where I'm also using the tink.js library.
In their introduction they are telling me to use this function to do something on click:
anySprite.press = () => {
//Do something when the pointer presses the sprite
};
But it just sends me an error in the console. The structure looks weird to me.. Can this be the right way to use it?
I have a text, where I want something to happen when it is clicked, so I used
t.makeInteractive(varD);
And then in the play function
varD.press = () => {
console.log("pressed");
};
But it just returns [Error] SyntaxError: Unexpected token ')'
What am I doing wrong?
Also, is there an easier way to do something on click? Perhaps just using pixi.js without tink.js?
Hope someone can help