added documentation and changed api for callbacks
This commit is contained in:
parent
b4365bad8e
commit
e375e213f7
4 changed files with 490 additions and 64 deletions
|
@ -81,7 +81,7 @@ const memory = try allocator.alloc(u8, min_memory_size);
|
|||
defer allocator.free(memory);
|
||||
const arena: clay.Arena = clay.createArenaWithCapacityAndMemory(memory);
|
||||
_ = clay.initialize(arena, .{ .h = 1000, .w = 1000 }, .{});
|
||||
clay.setMeasureTextFunction(renderer.measureText);
|
||||
clay.setMeasureTextFunction(void, {}, renderer.measureText);
|
||||
```
|
||||
|
||||
3. Provide a `measureText(text, config)` function with [clay.setMeasureTextFunction(function)](https://github.com/nicbarker/clay/blob/main/README.md#clay_setmeasuretextfunction) so that clay can measure and wrap text.
|
||||
|
|
|
@ -546,7 +546,7 @@ pub fn main() !void {
|
|||
defer allocator.free(memory);
|
||||
const arena: cl.Arena = cl.createArenaWithCapacityAndMemory(memory);
|
||||
_ = cl.initialize(arena, .{ .h = 1000, .w = 1000 }, .{});
|
||||
cl.setMeasureTextFunction({}, renderer.measureText);
|
||||
cl.setMeasureTextFunction(void, {}, renderer.measureText);
|
||||
|
||||
// init raylib
|
||||
rl.setConfigFlags(.{
|
||||
|
|
|
@ -85,7 +85,7 @@ pub fn main() !void {
|
|||
defer allocator.free(memory);
|
||||
const arena: cl.Arena = cl.createArenaWithCapacityAndMemory(memory);
|
||||
_ = cl.initialize(arena, .{ .h = 1000, .w = 1000 }, .{});
|
||||
cl.setMeasureTextFunction({}, renderer.measureText);
|
||||
cl.setMeasureTextFunction(void, {}, renderer.measureText);
|
||||
|
||||
// init raylib
|
||||
rl.setConfigFlags(.{
|
||||
|
|
548
src/root.zig
548
src/root.zig
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue