mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-26 18:21:04 +00:00
Add touch_controls
boolean to get_player_window_information()
(#14092)
This commit is contained in:
parent
7162b536eb
commit
91ba02449b
8 changed files with 40 additions and 3 deletions
|
@ -7,6 +7,8 @@ local function show_fullscreen_fs(name)
|
|||
print(dump(window))
|
||||
|
||||
local size = { x = window.max_formspec_size.x * 1.1, y = window.max_formspec_size.y * 1.1 }
|
||||
local touch_text = window.touch_controls and "Touch controls enabled" or
|
||||
"Touch controls disabled"
|
||||
local fs = {
|
||||
"formspec_version[4]",
|
||||
("size[%f,%f]"):format(size.x, size.y),
|
||||
|
@ -16,7 +18,8 @@ local function show_fullscreen_fs(name)
|
|||
("button[%f,%f;1,1;%s;%s]"):format(size.x - 1, size.y - 1, "br", "BR"),
|
||||
("button[%f,%f;1,1;%s;%s]"):format(0, size.y - 1, "bl", "BL"),
|
||||
|
||||
("label[%f,%f;%s]"):format(size.x / 2, size.y / 2, "Fullscreen")
|
||||
("label[%f,%f;%s]"):format(size.x / 2, size.y / 2, "Fullscreen"),
|
||||
("label[%f,%f;%s]"):format(size.x / 2, size.y / 2 + 1, touch_text),
|
||||
}
|
||||
|
||||
minetest.show_formspec(name, "testfullscreenfs:fs", table.concat(fs))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue