Skip to content

CreateMapPicture

Hangs one of the map’s pictures on the level - a poster, a banner, a painting, a shop’s sign.

A picture is a PNG file the owner puts in the map folder’s pictures/ folder (its name - letters a-z first, then letters, digits, _ and - - is the picture’s; at most 2048 pixels a side, 64 pictures and 8 megapixels in all; ReloadMapPictures or /map pictures reload after adding one). The server reads it and every player’s game gets its pixels with the map, once, and keeps them. It stands on a board at (x, y, z) - its middle -, its face looking where yaw turns (as a player’s yaw: 0 faces +Y), opts.width metres wide (1) and as tall as the picture is for that width unless opts.height says otherwise; pitch tips it back, roll turns it about its face. A picture with see-through parts shows the world behind them, soft, unless transparent is "cutout" (hard edges) or false (a plain board under them). With attach it sits on another map object and moves with it. It is a map object like any other (SetMapObject, DeleteMapObject, a layer, persist); never solid. In the editor: “Pictures and pages” in the panel, then a click on a wall.

CreateMapPicture(name, x, y, z [, opts])
Parameter Type
name string the picture’s name (its file’s, without .png)
x number metres - the board’s middle
y number metres
z number metres
opts table any of yaw, pitch, roll (degrees), width (metres, 0.1 .. 20; 1), height (metres; the picture’s shape), transparent (true / "blend" soft, "cutout" hard, false a plain board; soft for a picture with see-through parts, else plain), glow (0 .. 1: how bright it stays at night; 0), use (a use prompt - OnPlayerUseMapObject), attach (the map object it sits on), layer, group, persist (optional)

number - the map object’s id; nil and the reason (no such picture, a size out of bounds, no map …)

-- the tavern's sign over its door, on the wall it hangs on
local id = CreateMapPicture("tavern_sign", 1288.4, 1102.9, 34.2, {yaw = 90, width = 1.6, attach = TAVERN_WALL})

GetMapPictures · CreateMapSurface · SetMapObject · ReloadMapPictures · the The server’s map group of the index