[Core] Clay_GetElementIdsAtPoint #241
Open
+63
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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: