Jump to content

tink.js strange function


Recommended Posts

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


And then in the play function

varD.press = () => {

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...