Sign in to follow this  

Making a button activate when the mouse pointer is over it and a mouse button is pressed?

Recommended Posts

The onInputDown handler only works if you press the mouse button after you hover over the button.  If you hold down the mouse button and then hover over the button, it does nothing.  I want to be able to activate the button by just hovering over it with the mouse button held down, even if I don't "click" per se.

Share this post

Link to post
Share on other sites

I am not sure what you mean, still want to help ;) Are you looking something like this (the btnover functionality):

function create() {  button = game.add.button(100, 1, 'button', btnclick, this);  button.onInputOver.add(btnover, this);}function btnclick() {  console.log('button click');}function btnover() {  console.log('button over');}

Same thing in JSFiddle:   (imagine that hello world as button)

Share this post

Link to post
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.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.