aboutsummaryrefslogtreecommitdiff
path: root/doc/menu_lua_api.txt
diff options
context:
space:
mode:
authorrubenwardy <rw@rubenwardy.com>2023-02-27 22:58:41 +0000
committerGitHub <noreply@github.com>2023-02-27 22:58:41 +0000
commit39f4d26177ec1c8f246133c532a42ef7429bc36d (patch)
tree910b6a6635adf37eaba1d7410e83fad14f15bb90 /doc/menu_lua_api.txt
parentfbbdae93ee324584089efaf8e880a1378f6a2ad6 (diff)
downloadminetest-39f4d26177ec1c8f246133c532a42ef7429bc36d.tar.xz
Add minetest.get_player_window_information() (#12367)
Diffstat (limited to 'doc/menu_lua_api.txt')
-rw-r--r--doc/menu_lua_api.txt45
1 files changed, 35 insertions, 10 deletions
diff --git a/doc/menu_lua_api.txt b/doc/menu_lua_api.txt
index ad07ea732..e8d7b6e40 100644
--- a/doc/menu_lua_api.txt
+++ b/doc/menu_lua_api.txt
@@ -203,17 +203,42 @@ GUI
will be added to fieldname value is set to formname itself
* if `is_file_select` is `true`, a file and not a folder will be selected
* returns nil or selected file/folder
-* `core.get_screen_info()`
- * returns
+* `core.get_active_renderer()`: Ex: "OpenGL 4.6".
+* `core.get_window_info()`: Same as server-side `get_player_window_information` API.
+
+ -- Note that none of these things are constant, they are likely to change
+ -- as the player resizes the window and moves it between monitors
+ --
+ -- real_gui_scaling and real_hud_scaling can be used instead of DPI.
+ -- OSes don't necessarily give the physical DPI, as they may allow user configuration.
+ -- real_*_scaling is just OS DPI / 96 but with another level of user configuration.
+ {
+ -- Current size of the in-game render target.
+ --
+ -- This is usually the window size, but may be smaller in certain situations,
+ -- such as side-by-side mode.
+ size = {
+ x = 1308,
+ y = 577,
+ },
+
+ -- Estimated maximum formspec size before Minetest will start shrinking the
+ -- formspec to fit. For a fullscreen formspec, use a size 10-20% larger than
+ -- this and `padding[-0.01,-0.01]`.
+ max_formspec_size = {
+ x = 20,
+ y = 11.25
+ },
+
+ -- GUI Scaling multiplier
+ -- Equal to the setting `gui_scaling` multiplied by `dpi / 96`
+ real_gui_scaling = 1,
+
+ -- HUD Scaling multiplier
+ -- Equal to the setting `hud_scaling` multiplied by `dpi / 96`
+ real_hud_scaling = 1,
+ }
- {
- density = <screen density 0.75,1.0,2.0,3.0 ... (dpi)>,
- display_width = <width of display>,
- display_height = <height of display>,
- window_width = <current window width>,
- window_height = <current window height>,
- render_info = <active render information>
- }
Content and Packages