Watch
2
0
Fork
You've already forked raylib-cs
0
This commit is contained in:
MrScautHD 2023-12-27 10:21:23 +01:00
commit f3ec5cf0a7
2 changed files with 8 additions and 1 deletions

View file

@ -1429,7 +1429,7 @@ public static unsafe partial class Raylib
/// <summary>Generate image: grayscale image from text data</summary> /// <summary>Generate image: grayscale image from text data</summary>
[DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] [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 // Image manipulation functions

View file

@ -422,6 +422,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, str1.AsPointer());
}
/// <summary>Create an image from text (default font)</summary> /// <summary>Create an image from text (default font)</summary>
public static Image ImageText(string text, int fontSize, Color color) public static Image ImageText(string text, int fontSize, Color color)
{ {