mirror of
https://github.com/nicbarker/clay.git
synced 2025-04-15 10:48:04 +00:00
Add some docs
This commit is contained in:
parent
1ef4d59601
commit
ed4b43f739
34
README.md
34
README.md
@ -177,6 +177,7 @@ For help starting out or to discuss clay, considering joining [the discord serve
|
||||
- [Clay_PointerOver](#clay_pointerover)
|
||||
- [Clay_GetScrollContainerData](#clay_getscrollcontainerdata)
|
||||
- [Clay_GetElementId](#clay_getelementid)
|
||||
- [Clay_GetElementIdsAtPoint](#clay_getelementidsatpoint)
|
||||
- [Element Macros](#element-macros)
|
||||
- [CLAY](#clay-1)
|
||||
- [CLAY_ID](#clay_id)
|
||||
@ -197,6 +198,7 @@ For help starting out or to discuss clay, considering joining [the discord serve
|
||||
- [Clay_ScrollContainerData](#clay_scrollcontainerdata)
|
||||
- [Clay_ErrorHandler](#clay_errorhandler)
|
||||
- [Clay_ErrorData](#clay_errordata)
|
||||
- [Clay_PointQueryResult](#clay_pointqueryresult)
|
||||
|
||||
## High Level Documentation
|
||||
|
||||
@ -728,6 +730,14 @@ Returns [Clay_ScrollContainerData](#clay_scrollcontainerdata) for the scroll con
|
||||
|
||||
Returns a [Clay_ElementId](#clay_elementid) for the provided id string, used for querying element info such as mouseover state, scroll container data, etc.
|
||||
|
||||
### Clay_GetElementIdsAtPoint
|
||||
|
||||
`Clay_PointQueryResult Clay_GetElementIdsAtPoint(Clay_Vector2 position)`
|
||||
|
||||
Returns a [Clay_PointQueryResult](#clay_pointqueryresult) that contains a sorted stack of element ids at the specified position. This allows querying elements similar to [Clay_SetPointerState](#clay_setpointerstate), but without triggering hover functions or affecting hover states.
|
||||
|
||||
> ⚠️ The returned Clay_PointQueryResult object becomes invalid the next time you call `Clay_GetElementIdsAtPoint`. If you need to call this multiple times in a frame, you will need to copy the data out of the Clay_PointQueryResult struct.
|
||||
|
||||
## Element Macros
|
||||
|
||||
### CLAY()
|
||||
@ -2129,3 +2139,27 @@ A [Clay_String](#clay_string) that provides a human readable description of the
|
||||
A generic pointer to extra userdata that is transparently passed through from `Clay_Initialize` to Clay's error handler callback. Defaults to NULL.
|
||||
|
||||
---
|
||||
|
||||
### Clay_PointQueryResult
|
||||
|
||||
```C
|
||||
typedef struct
|
||||
{
|
||||
int32t length;
|
||||
const Clay_ElementId *results;
|
||||
} Clay_PointQueryResult;
|
||||
```
|
||||
|
||||
**Fields**
|
||||
|
||||
**`.length`** - `int32_t`
|
||||
|
||||
The number of element ids contained in `.results`.
|
||||
|
||||
---
|
||||
|
||||
**`.results`** - `Clay_ElementId*`
|
||||
|
||||
A pointer to a sorted array of `.length` [Clay_ElementIds](#clay_elementid), starting with the root element.
|
||||
|
||||
---
|
||||
|
Loading…
Reference in New Issue
Block a user