updated raylib-sidebar-scrolling-container example for naming changes

This commit is contained in:
johan0A 2024-10-11 21:40:48 +02:00
parent 8d3a9785da
commit d2e64b3bba
2 changed files with 3 additions and 3 deletions

View file

@ -67,7 +67,7 @@ fn createLayout(profile_picture: *const rl.Texture2D) cl.ClayArray(cl.RenderComm
cl.imageConfig(.{ .source_dimensions = .{ .h = 60, .w = 60 }, .image_data = @ptrCast(@constCast(profile_picture)) }), cl.imageConfig(.{ .source_dimensions = .{ .h = 60, .w = 60 }, .image_data = @ptrCast(@constCast(profile_picture)) }),
); );
cl.closeParent(); cl.closeParent();
cl.text(cl.ID("profileTitle"), "Clay - UI Library", cl.textConfig(.{ .font_size = 24, .text_color = light_grey })); cl.text(cl.ID("profileTitle"), "Clay - UI Library", cl.textConfig(.{ .font_size = 24, .color = light_grey }));
} }
for (0..5) |i| { for (0..5) |i| {

View file

@ -26,7 +26,7 @@ pub fn clayRaylibRender(render_commands: *cl.ClayArray(cl.RenderCommand), alloca
const cloned = allocator.dupeZ(c_char, text) catch unreachable; const cloned = allocator.dupeZ(c_char, text) catch unreachable;
defer allocator.free(cloned); defer allocator.free(cloned);
const fontToUse: rl.Font = raylib_fonts[render_command.config.text_element_config.font_id].?; const fontToUse: rl.Font = raylib_fonts[render_command.config.text_element_config.font_id].?;
rl.setTextLineSpacing(render_command.config.text_element_config.lineSpacing); rl.setTextLineSpacing(render_command.config.text_element_config.line_spacing);
rl.drawTextEx( rl.drawTextEx(
fontToUse, fontToUse,
@ptrCast(@alignCast(cloned.ptr)), @ptrCast(@alignCast(cloned.ptr)),
@ -190,7 +190,7 @@ pub fn measureText(clay_text: []const u8, config: *cl.TextElementConfig) cl.Dime
const text: []const u8 = clay_text; const text: []const u8 = clay_text;
const font_size: f32 = @floatFromInt(config.font_size); const font_size: f32 = @floatFromInt(config.font_size);
const letter_spacing: f32 = @floatFromInt(config.letter_spacing); const letter_spacing: f32 = @floatFromInt(config.letter_spacing);
const line_spacing = config.lineSpacing; const line_spacing = config.line_spacing;
var temp_byte_counter: usize = 0; var temp_byte_counter: usize = 0;
var byte_counter: usize = 0; var byte_counter: usize = 0;