Edited gui.text to return a value, the x position where it would paint the next character. This should hopefully allow scripters to place a useful box around the text, perhaps for looks or clicking like it's a button.
This commit is contained in:
parent
bb767b0d49
commit
a8fa67db16
|
@ -1,3 +1,4 @@
|
||||||
|
06-june-2010 - FatRatKnight - Added a return value to gui.text: The X position where the function would paint the next character.
|
||||||
02-june-2010 - adelikat - Win32 - Movie Options Dialog - Fix so Full Savestate Load checkbox is updated on load
|
02-june-2010 - adelikat - Win32 - Movie Options Dialog - Fix so Full Savestate Load checkbox is updated on load
|
||||||
|
|
||||||
---r1984 - FCEUX 2.1.4a Release---
|
---r1984 - FCEUX 2.1.4a Release---
|
||||||
|
|
|
@ -3794,7 +3794,7 @@ static int JoedCharWidth(uint8 ch)
|
||||||
return FCEUFont[FixJoedChar(ch)*8];
|
return FCEUFont[FixJoedChar(ch)*8];
|
||||||
}
|
}
|
||||||
|
|
||||||
void LuaDrawTextTransWH(const char *str, size_t l, int x, int y, uint32 color, uint32 backcolor)
|
void LuaDrawTextTransWH(const char *str, size_t l, int &x, int y, uint32 color, uint32 backcolor)
|
||||||
{
|
{
|
||||||
int Opac = (color >> 24) & 0xFF;
|
int Opac = (color >> 24) & 0xFF;
|
||||||
int backOpac = (backcolor >> 24) & 0xFF;
|
int backOpac = (backcolor >> 24) & 0xFF;
|
||||||
|
@ -3893,8 +3893,10 @@ static int gui_text(lua_State *L) {
|
||||||
gui_prepare();
|
gui_prepare();
|
||||||
|
|
||||||
LuaDrawTextTransWH(msg, l, x, y, color, bgcolor);
|
LuaDrawTextTransWH(msg, l, x, y, color, bgcolor);
|
||||||
|
|
||||||
|
lua_pushinteger(L, x);
|
||||||
#endif
|
#endif
|
||||||
return 0;
|
return 1;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue