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

Changing the cursor depending on location in the View #118

Open
TheBizzle opened this issue Feb 27, 2014 · 4 comments
Open

Changing the cursor depending on location in the View #118

TheBizzle opened this issue Feb 27, 2014 · 4 comments

Comments

@TheBizzle
Copy link
Member

It would be nice for certain models (e.g. Bug Hunters Competition) to be able to have a different cursor when the mouse is over something clickable. This isn't possible in JVM NetLogo, but maybe the freedom afforded by our new platform makes it easier...? I'm not sure.

I looked into the issue a bit, but the only half-good answer I came up with was to put clickable things into their own canvases. Arguments against that:

  • Might be a pain to implement
  • Could cause performance problems
  • Would still be un-ideal, since clickables would have to be squares, unless you overlaid unclickable canvases over the unclickable regions... but now this is getting crazy
@qiemem
Copy link
Member

qiemem commented Feb 27, 2014

On mouse move, we can manually check to see if the mouse is over something clickable. If it is, alter the css of the view (the whole view) to change the cursor. If not, make sure mouse pointer is default shape. This gives us non-square clickable areas with no performance hit.

@TheBizzle
Copy link
Member Author

On mouse move, we can manually check to see if the mouse is over something clickable

How do you know when some shape within the canvas is clickable?

@qiemem
Copy link
Member

qiemem commented Feb 27, 2014

How do you know when some shape within the canvas is clickable?

This is a problem no matter which method we choose for changing the mouse cursor.

We could just add an agent variable clickable so that users can flag agents.

Alternatively, we could consider all turtles clickable. This is somewhat true, given inspection.

@TheBizzle
Copy link
Member Author

How do you know when some shape within the canvas is clickable?

This is a problem no matter which method we choose for changing the mouse cursor.

Well, what was half-proposing with individual canvases was that the clickable canvas would have CSS for changing the cursor on hover. Then the only code run for figuring out whether or not something is clickable is handled when the item's canvas is created.

We could just add an agent variable clickable so that users can flag agents.

Right, but then we have to constantly examine what agent (if any) is under the mouse and check its clickable. Not saying that that's necessarily undoable or undesirable, but I would expect a performance hit from that, so I'm wary.

Alternatively, we could consider all turtles clickable. This is somewhat true, given inspection.

Eh, seems problematic to me. Turtles are traditionally inspected through right-clicking. Left-clicking is intuitively used for actions upon turtles in interactive-View models like Bug Hunters Competition. Also, patches are inspectable, so they, too, then, would intuitively be considered "clickable". And links. So, basically, the whole model is "clickable".

@qiemem qiemem removed their assignment Mar 29, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants