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

Fix GenImageText bug/add utility method (#213)

This commit is contained in:
Rgebee 2023-12-26 10:00:15 +00:00 committed by GitHub
commit 47956acdd4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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)
{