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/lua_api.txt') 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