Deprecate `IGuiApi.DrawText` in favour of new method `PixelText`
to match Lua
This commit is contained in:
parent
132029d18f
commit
6387291e37
|
@ -544,6 +544,23 @@ namespace BizHawk.Client.Common
|
|||
}
|
||||
|
||||
public void DrawText(int x, int y, string message, Color? forecolor = null, Color? backcolor = null, string fontfamily = null, DisplaySurfaceID? surfaceID = null)
|
||||
=> PixelText(
|
||||
x: x,
|
||||
y: y,
|
||||
message: message,
|
||||
forecolor: forecolor,
|
||||
backcolor: backcolor,
|
||||
fontfamily: fontfamily,
|
||||
surfaceID: surfaceID);
|
||||
|
||||
public void PixelText(
|
||||
int x,
|
||||
int y,
|
||||
string message,
|
||||
Color? forecolor = null,
|
||||
Color? backcolor = null,
|
||||
string fontfamily = null,
|
||||
DisplaySurfaceID? surfaceID = null)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
|
|
@ -56,8 +56,12 @@ namespace BizHawk.Client.Common
|
|||
void DrawString(int x, int y, string message, Color? forecolor = null, Color? backcolor = null, int? fontsize = null, string fontfamily = null, string fontstyle = null, string horizalign = null, string vertalign = null, DisplaySurfaceID? surfaceID = null);
|
||||
|
||||
/// <remarks>exposed to Lua as <c>gui.pixelText</c></remarks>
|
||||
[Obsolete("method renamed to PixelText to match Lua")]
|
||||
void DrawText(int x, int y, string message, Color? forecolor = null, Color? backcolor = null, string fontfamily = null, DisplaySurfaceID? surfaceID = null);
|
||||
|
||||
/// <remarks>exposed to Lua as <c>gui.pixelText</c></remarks>
|
||||
void PixelText(int x, int y, string message, Color? forecolor = null, Color? backcolor = null, string fontfamily = null, DisplaySurfaceID? surfaceID = null);
|
||||
|
||||
/// <remarks>exposed to Lua as <c>gui.text</c></remarks>
|
||||
void Text(int x, int y, string message, Color? forecolor = null, string anchor = null);
|
||||
}
|
||||
|
|
|
@ -313,7 +313,7 @@ namespace BizHawk.Client.Common
|
|||
[LuaColorParam] object backcolor = null,
|
||||
string fontfamily = null,
|
||||
string surfaceName = null)
|
||||
=> APIs.Gui.DrawText(x, y, message, _th.SafeParseColor(forecolor), _th.SafeParseColor(backcolor) ?? APIs.Gui.GetDefaultTextBackground().Value, fontfamily, surfaceID: UseOrFallback(surfaceName));
|
||||
=> APIs.Gui.PixelText(x, y, message, _th.SafeParseColor(forecolor), _th.SafeParseColor(backcolor) ?? APIs.Gui.GetDefaultTextBackground().Value, fontfamily, surfaceID: UseOrFallback(surfaceName));
|
||||
|
||||
[LuaMethodExample("gui.text( 16, 32, \"Some message\", 0x7F0000FF, \"bottomleft\" );")]
|
||||
[LuaMethod("text", "Displays the given text on the screen at the given coordinates. Optional Foreground color. The optional anchor flag anchors the text to one of the four corners. Anchor flag parameters: topleft, topright, bottomleft, bottomright")]
|
||||
|
|
Loading…
Reference in New Issue