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

[Core] Clay_GetElementIdsAtPoint #241

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

monodop
Copy link
Contributor

@monodop monodop commented Jan 30, 2025

regarding #231 - Get an ordered list of elements at an arbitrary point or set of points. Example: click/hover; drag & drop; local multiplayer game with multiple cursors.

I wasn't sure what we wanted to do with SetPointerState - I wanted a version of this function that I could use arbitrarily to do the same behavior, except I don't want it to do any hover callbacks or store any information about pointer state.

As a result, I made this version, which is basically just copy/pasted but with those parts removed. Maybe this could be refactored so that SetPointerState calls this?

In order to get this working, I needed a place to store the element list in the first place. The approach I went with here is to just create a pointQueryIds list, where results will be stored. The downside is that if you call this multiple times, you'll need to manually save the results yourself outside of clay. I'm open to suggestions on a better approach, but this does seem to work.

TODO:

  • docs
  • update bindings
  • examples

@monodop monodop changed the title Clay_GetElementIdsAtPoint [Core] Clay_GetElementIdsAtPoint Jan 30, 2025
@monodop
Copy link
Contributor Author

monodop commented Jan 30, 2025

In order to avoid confusion, maybe we should add a second method to retrieve the pointerOverIds from SetPointerState? I'm still not sure how I feel about having these two separate functions that work independently.

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

Successfully merging this pull request may close these issues.

1 participant