Watch
2
0
Fork
You've already forked raylib-cs
0

Fix GenImageText bug/add util method

This commit is contained in:
Rgebee 2023-12-26 09:54:08 +00:00
commit 50634a32ec
2 changed files with 8 additions and 1 deletions

View file

@ -1324,7 +1324,7 @@ public static unsafe partial class Raylib
/// <summary>Generate image: grayscale image from text data</summary>
[DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Image GenImageText(int width, int height, int tileSize);
public static extern Image GenImageText(int width, int height, sbyte* text);
// Image manipulation functions

View file

@ -415,6 +415,13 @@ public static unsafe partial class Raylib
}
}
/// <summary>Generate image: grayscale image from text data</summary>
public static Image GenImageText(int width, int height, string text)
{
using var str1 = text.ToUtf8Buffer();
return GenImageText(width, height, text);
}
/// <summary>Create an image from text (default font)</summary>
public static Image ImageText(string text, int fontSize, Color color)
{