From 7c37b1891adcddc0e7d11e5faafddaa554443318 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Mart=C3=ADnez?= Date: Mon, 22 Apr 2013 06:53:55 -0300 Subject: Added support for alignment in HUD items --- doc/lua_api.txt | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'doc') diff --git a/doc/lua_api.txt b/doc/lua_api.txt index aa4503879..774448778 100644 --- a/doc/lua_api.txt +++ b/doc/lua_api.txt @@ -409,6 +409,9 @@ ranging in value from 0 to 1. The name field is not yet used, but should contain a description of what the HUD element represents. The direction field is the direction in which something is drawn. 0 draws from left to right, 1 draws from right to left, 2 draws from top to bottom, and 3 draws from bottom to top. +The alignment field specifies how the item will be aligned. It ranges from -1 to 1, +with 0 being the center, -1 is moved to the left/up, and 1 is to the right/down. Fractional +values can be used. Below are the specific uses for fields in each type; fields not listed for that type are ignored. Note: Future revisions to the HUD API may be incompatible; the HUD API is still in the experimental stages. @@ -418,6 +421,7 @@ Note: Future revisions to the HUD API may be incompatible; the HUD API is still - scale: The scale of the image, with 1 being the original texture size. Only the X coordinate scale is used. - text: The name of the texture that is displayed. + - alignment: The alignment of the image. - text Displays text on the HUD. - scale: Defines the bounding rectangle of the text. @@ -425,6 +429,7 @@ Note: Future revisions to the HUD API may be incompatible; the HUD API is still - text: The text to be displayed in the HUD element. - number: An integer containing the RGB value of the color used to draw the text. Specify 0xFFFFFF for white text, 0xFF0000 for red, and so on. + - alignment: The alignment of the text. - statbar Displays a horizontal bar made up of half-images. - text: The name of the texture that is used. @@ -1857,4 +1862,6 @@ HUD Definition (hud_add, hud_get) ^ Selected item in inventory. 0 for no item selected. direction = 0, ^ Direction: 0: left-right, 1: right-left, 2: top-bottom, 3: bottom-top + alignment = {x=0, y=0}, + ^ See "HUD Element Types" } -- cgit v1.2.3 From 9894167bbf516c40bf2b8577179ff8f13b8b54e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Mart=C3=ADnez?= Date: Mon, 22 Apr 2013 20:47:59 -0300 Subject: Added offset support for HUD items --- doc/lua_api.txt | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'doc') diff --git a/doc/lua_api.txt b/doc/lua_api.txt index 774448778..76f687f8e 100644 --- a/doc/lua_api.txt +++ b/doc/lua_api.txt @@ -412,6 +412,9 @@ The direction field is the direction in which something is drawn. The alignment field specifies how the item will be aligned. It ranges from -1 to 1, with 0 being the center, -1 is moved to the left/up, and 1 is to the right/down. Fractional values can be used. +The offset field specifies a pixel offset from the position. Contrary to position, +the offset is not scaled to screen size. This allows for some precisely-positioned +items in the HUD. Below are the specific uses for fields in each type; fields not listed for that type are ignored. Note: Future revisions to the HUD API may be incompatible; the HUD API is still in the experimental stages. @@ -422,6 +425,7 @@ Note: Future revisions to the HUD API may be incompatible; the HUD API is still Only the X coordinate scale is used. - text: The name of the texture that is displayed. - alignment: The alignment of the image. + - offset: offset in pixels from position. - text Displays text on the HUD. - scale: Defines the bounding rectangle of the text. @@ -430,12 +434,14 @@ Note: Future revisions to the HUD API may be incompatible; the HUD API is still - number: An integer containing the RGB value of the color used to draw the text. Specify 0xFFFFFF for white text, 0xFF0000 for red, and so on. - alignment: The alignment of the text. + - offset: offset in pixels from position. - statbar Displays a horizontal bar made up of half-images. - text: The name of the texture that is used. - number: The number of half-textures that are displayed. If odd, will end with a vertically center-split texture. - direction + - offset: offset in pixels from position. - inventory - text: The name of the inventory list to be displayed. - number: Number of items in the inventory to be displayed. @@ -1864,4 +1870,6 @@ HUD Definition (hud_add, hud_get) ^ Direction: 0: left-right, 1: right-left, 2: top-bottom, 3: bottom-top alignment = {x=0, y=0}, ^ See "HUD Element Types" + offset = {x=0, y=0}, + ^ See "HUD Element Types" } -- cgit v1.2.3 From 3d4d0cb5749a68436cccd08b7a135f9bb7527038 Mon Sep 17 00:00:00 2001 From: ShadowNinja Date: Fri, 29 Mar 2013 23:28:13 -0400 Subject: Add option to not prepend "Server -!- " to messages sent with minetest.chat_send_player() --- doc/lua_api.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'doc') diff --git a/doc/lua_api.txt b/doc/lua_api.txt index 76f687f8e..38e12882d 100644 --- a/doc/lua_api.txt +++ b/doc/lua_api.txt @@ -1005,7 +1005,8 @@ minetest.check_player_privs(name, {priv1=true,...}) -> bool, missing_privs Chat: minetest.chat_send_all(text) -minetest.chat_send_player(name, text) +minetest.chat_send_player(name, text, prepend) +^ prepend: optional, if it is set to false "Server -!- " will not be prepended to the message Inventory: minetest.get_inventory(location) -> InvRef -- cgit v1.2.3 From 4a9b8aae5e54e4cb6395771868a83bfd0f72c11a Mon Sep 17 00:00:00 2001 From: ShadowNinja Date: Thu, 4 Apr 2013 04:28:21 -0400 Subject: Add minetest.get_player_ip() --- doc/lua_api.txt | 1 + 1 file changed, 1 insertion(+) (limited to 'doc') diff --git a/doc/lua_api.txt b/doc/lua_api.txt index 38e12882d..531a40b29 100644 --- a/doc/lua_api.txt +++ b/doc/lua_api.txt @@ -1002,6 +1002,7 @@ minetest.auth_reload() ^ These call the authentication handler minetest.check_player_privs(name, {priv1=true,...}) -> bool, missing_privs ^ A quickhand for checking privileges +minetest.get_player_ip(name) -> IP address string Chat: minetest.chat_send_all(text) -- cgit v1.2.3 From 770305e28dc0ed9aea0eefe041477a46d64eee58 Mon Sep 17 00:00:00 2001 From: kwolekr Date: Tue, 23 Apr 2013 18:39:10 -0400 Subject: Add option to use texture alpha channel --- doc/lua_api.txt | 1 + 1 file changed, 1 insertion(+) (limited to 'doc') diff --git a/doc/lua_api.txt b/doc/lua_api.txt index 531a40b29..42579fda3 100644 --- a/doc/lua_api.txt +++ b/doc/lua_api.txt @@ -1649,6 +1649,7 @@ Node definition (register_node) ^ Special textures of node; used rarely (old field name: special_materials) ^ List can be shortened to needed length alpha = 255, + use_texture_alpha = false, -- Use texture's alpha channel post_effect_color = {a=0, r=0, g=0, b=0}, -- If player is inside node paramtype = "none", -- See "Nodes" paramtype2 = "none", -- See "Nodes" -- cgit v1.2.3 From e703c5b81f87550e636ebb1ebb1eb64027a44687 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Mart=C3=ADnez?= Date: Wed, 24 Apr 2013 07:52:46 -0300 Subject: Added support to disable built-in HUD elements --- doc/lua_api.txt | 3 +++ 1 file changed, 3 insertions(+) (limited to 'doc') diff --git a/doc/lua_api.txt b/doc/lua_api.txt index 42579fda3..b2106b64c 100644 --- a/doc/lua_api.txt +++ b/doc/lua_api.txt @@ -1433,6 +1433,9 @@ Player-only: (no-op for other objects) - hud_change(id, stat, value): change a value of a previously added HUD element ^ element stat values: position, name, scale, text, number, item, dir - hud_get(id): gets the HUD element definition structure of the specified ID +- hud_builtin_enable(what, flag): enable or disable built-in HUD items + ^ what: "hotbar", "healthbar", "crosshair", "wielditem" + ^ flag: true/false InvRef: Reference to an inventory methods: -- cgit v1.2.3 From 625a4c2e662f6b69b73a2a828d1b08d72e53ff73 Mon Sep 17 00:00:00 2001 From: RealBadAngel Date: Thu, 25 Apr 2013 02:39:21 +0200 Subject: Add new drawtype GLASSLIKE_FRAMED --- doc/lua_api.txt | 1 + 1 file changed, 1 insertion(+) (limited to 'doc') diff --git a/doc/lua_api.txt b/doc/lua_api.txt index b2106b64c..5b1942aef 100644 --- a/doc/lua_api.txt +++ b/doc/lua_api.txt @@ -329,6 +329,7 @@ Look for examples in games/minimal or games/minetest_game. - liquid - flowingliquid - glasslike +- glasslike_framed - allfaces - allfaces_optional - torchlike -- cgit v1.2.3 From d3f0ce62240b7598eded13153eacb410bf2420a1 Mon Sep 17 00:00:00 2001 From: kwolekr Date: Thu, 25 Apr 2013 19:27:22 -0400 Subject: Generalize hud_builtin_enable into hud_set_flags --- doc/lua_api.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'doc') diff --git a/doc/lua_api.txt b/doc/lua_api.txt index 5b1942aef..07fb1ccd6 100644 --- a/doc/lua_api.txt +++ b/doc/lua_api.txt @@ -1434,9 +1434,10 @@ Player-only: (no-op for other objects) - hud_change(id, stat, value): change a value of a previously added HUD element ^ element stat values: position, name, scale, text, number, item, dir - hud_get(id): gets the HUD element definition structure of the specified ID -- hud_builtin_enable(what, flag): enable or disable built-in HUD items - ^ what: "hotbar", "healthbar", "crosshair", "wielditem" - ^ flag: true/false +- hud_set_flags(flags): sets specified HUD flags to true/false + ^ flags: (is visible) hotbar, healthbar, crosshair, wielditem + ^ pass a table containing a true/false value of each flag to be set or unset + ^ if a flag is nil, the flag is not modified InvRef: Reference to an inventory methods: -- cgit v1.2.3 From a4183994a446a065e3151745b4167270ebae6194 Mon Sep 17 00:00:00 2001 From: Sfan5 Date: Wed, 1 May 2013 12:31:21 +0200 Subject: Add a Way of checking for specific Feature with Lua Adds minetest.get_feature() and minetest.has_feature() --- doc/lua_api.txt | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'doc') diff --git a/doc/lua_api.txt b/doc/lua_api.txt index 07fb1ccd6..597f98c2c 100644 --- a/doc/lua_api.txt +++ b/doc/lua_api.txt @@ -912,6 +912,11 @@ minetest.get_modnames() -> list of installed mods minetest.get_worldpath() -> eg. "/home/user/.minetest/world" ^ Useful for storing custom data minetest.is_singleplayer() +minetest.features +^ table containing API feature flags: {foo=true, bar=true} +minetest.has_feature(arg) -> bool, missing_features +^ arg: string or table in format {foo=true, bar=true} +^ missing_features: {foo=true, bar=true} minetest.debug(line) ^ Always printed to stderr and logfile (print() is redirected here) -- cgit v1.2.3