Concatenate a string and value in raylib

I’m trying to use the raylib drawText() function. The first argument is a string and I want to print a value with the string. While I can’t concatenate it like "Mode: " ++ @tagName(gameMode) I found a solution, where I can use it with another raylib function: rl.textFormat(). This function takes a string and an anytype, and returns a string.
Here’s some of my code:

const GameMode = enum {
    Intro,
    Game,
    Editor,
};

gameMode: GameMode;
...
        rl.drawText(rl.textFormat("Mode: %c", .{@tagName(gameMode)}), 10, 10, 10, rl.Color.red);

So you can tell, I would like to print the text on the screen based on which state of the game I’m in.

This is the compiler error I get:
error: cannot pass '[:0]const u8' to variadic function return std.mem.span(@call(.auto, cdef.TextFormat, .{@as([*c]const u8, @ptrCast(text))} ++ args));
I know the %c might be bad too, but couldn’t find any other solution.

This is an example code that works, this is where I’m copying the idea:

            rl.drawText(
                rl.textFormat("[F] flag_fullscreen_mode: %d", .{
                    @as(i32, @intFromBool(rl.isWindowState(rl.ConfigFlags { .fullscreen_mode = true }))),
                }),
                10,
                80,
                10,
                rl.Color.lime,
            );

rl.textFormat uses C-style variadic arguments, so you need to pass all arguments separately. For this reason, you don’t need to surround them with .{}.

rl.drawText(rl.textFormat("Mode: %c", @tagName(gameMode)), 10, 10, 10, rl.Color.red);

Also I think you need to use %s instead of %c. You can find table of all formaters here https://cplusplus.com/reference/cstdio/printf/

I tried that too, but I got this error:
@compileError("Args should be in a tuple (call this function like textFormat(.{arg1, arg2, ...});)!");

rl.drawText(rl.textFormat("Mode: %d", .{@as(i32, @intFromEnum(gameMode))}), 10, 30, 20, rl.Color.red);
This works, but obviously I would like to see the string and not the value.

hm intresting try to use this

rl.drawText(rl.textFormat("Mode: %c", .{@as([*c]const u8, @tagName(gameMode))}), 10, 10, 10, rl.Color.red);

It works, but with %s. Ok this [*c]const u8 was that I missed. Interesting.

I think its fault of a raylib-zig. It can certanly cast passed [:0]const u8 to [*c]const u8 on its own as it does with text argument. Also @ptrCast is unnecessary there)