Add canvas UI node

This commit is contained in:
ShadelessFox 2025-01-19 14:10:52 +01:00
parent cb960ceaad
commit ee31f401aa
No known key found for this signature in database
GPG key ID: 1CF8D77ADDADADD9
12 changed files with 279 additions and 2 deletions

View file

@ -156,6 +156,25 @@ Properties:
| ----- | ------ | ---- | ----- | ------------ |
| src | string | yes | yes | texture name |
## Canvas
Properties:
| Title | Type | Read | Write | Description |
|-------|--------| ---- |-------|-------------|
| data | Canvas | yes | no | canvas data |
Methods:
| Method | Description |
|----------------------------------------------------------|---------------------------------------------------------|
| data:at(x: int, y: int) | returns an RGBA pixel at the given coordinates |
| data:set(x: int, y: int, rgba: int) | updates an RGBA pixel at the given coordinates |
| data:set(x: int, y: int, r: int, g: int, b: int) | updates an RGBA pixel at the given coordinates |
| data:set(x: int, y: int, r: int, g: int, b: int, a: int) | updates an RGBA pixel at the given coordinates |
| data:update() | applies changes to the canvas and uploads it to the GPU |
## Inventory
Properties: