gui.text(int x, int y, string msg) Displays the given text on the screen, using the same font and techniques as the main HUD.
| 4639 | // Displays the given text on the screen, using the same font and techniques as the |
| 4640 | // main HUD. |
| 4641 | static int gui_text(lua_State *L) { |
| 4642 | |
| 4643 | //extern int font_height; |
| 4644 | const char *msg; |
| 4645 | int x, y; |
| 4646 | size_t l; |
| 4647 | |
| 4648 | x = luaL_checkinteger(L,1); |
| 4649 | y = luaL_checkinteger(L,2); |
| 4650 | msg = luaL_checklstring(L,3,&l); |
| 4651 | |
| 4652 | //if (x < 0 || x >= LUA_SCREEN_WIDTH || y < 0 || y >= (LUA_SCREEN_HEIGHT - font_height)) |
| 4653 | // luaL_error(L,"bad coordinates"); |
| 4654 | |
| 4655 | #if 0 |
| 4656 | uint32 colour = gui_optcolour(L,4,LUA_BUILD_PIXEL(255, 255, 255, 255)); |
| 4657 | uint32 borderColour = gui_optcolour(L,5,LUA_BUILD_PIXEL(255, 0, 0, 0)); |
| 4658 | |
| 4659 | gui_prepare(); |
| 4660 | |
| 4661 | LuaDisplayString(msg, y, x, colour, borderColour); |
| 4662 | #else |
| 4663 | uint32 color = gui_optcolour(L,4,LUA_BUILD_PIXEL(255, 255, 255, 255)); |
| 4664 | uint32 bgcolor = gui_optcolour(L,5,LUA_BUILD_PIXEL(255, 27, 18, 105)); |
| 4665 | |
| 4666 | gui_prepare(); |
| 4667 | |
| 4668 | LuaDrawTextTransWH(msg, l, x, y, color, bgcolor); |
| 4669 | |
| 4670 | lua_pushinteger(L, x); |
| 4671 | #endif |
| 4672 | return 1; |
| 4673 | |
| 4674 | } |
| 4675 | |
| 4676 | |
| 4677 | // gui.gdoverlay([int dx=0, int dy=0,] string str [, sx=0, sy=0, sw, sh] [, float alphamul=1.0]) |
nothing calls this directly
no test coverage detected