Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mouse events does not work #42

Open
ChristerNilsson opened this issue May 23, 2018 · 5 comments
Open

mouse events does not work #42

ChristerNilsson opened this issue May 23, 2018 · 5 comments

Comments

@ChristerNilsson
Copy link

No description provided.

@duncangeere
Copy link
Contributor

I'm also finding that mouse events aren't working.

@ChristerNilsson
Copy link
Author

As this project unfortunately seems to be a dead parrot, I have switched to SVG and Raphael.

@runemadsen
Copy link
Owner

@ChristerNilsson I don't consider this project dead, as I'm using it continuously in my own work. However, I don't have time to work for free on every feature that someone requests in a one-line issue. Which mouse events are you speaking of? Are they global or on specific shapes? Please post a code example to help with debugging. Since this is an open source project, I would be more than happy to receive pull requests if you want to add functionality to rune.js or solve an existing bug.

@duncangeere
Copy link
Contributor

@runemadsen I'm glad the project is still alive! Thanks for your time creating it - I've used it for a lot of my pen plotter generative art.

Here's a very simple example that doesn't work for me, running the latest versions of Firefox and OSX.

var r = new Rune({
    container: "body",
    width: 500,
    height: 500
});

r.on("click", function () {r.circle(Math.random() * r.width, Math.random() * r.height, 50, 50)})

r.play();

Using the browser tools, I can see the SVG, I can see there's an event listener attached to it, but clicking the SVG does not place a circle as expected.

Perhaps I'm using the r.on() function in the wrong way? My Javascript skills aren't up to the task of tracking down and fixing the error, but any guidance would be appreciated.

@ChristerNilsson
Copy link
Author

This works:

r.el.addEventListener('click', function (mouse) {	
	r.circle(mouse.x, mouse.y, 50, 50)
})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants