Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:LCDBitmapSetImage

From RoR Wiki
Revision as of 19:45, 16 October 2026 by Maintenance script (talk | contribs) (UI Lua API import (WAR 1.4.8))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

UI Lua API · LCD functions
Version: WAR 1.4.8

Loads a .bmp image file into an LCD bitmap element.

LCDBitmapSetImage(pageName, bitmapName, imageFile, resizeToImage)

Arguments

pageName
string – Name of the page.
bitmapName
string – Name of a bitmap element created with LCDCreateBitmap.
imageFile
string – Path of a Windows bitmap file, relative to the folder of the addon that is running the code.
resizeToImage
boolean – true to size the element to the image's width and height.

Returns

Nothing.

Details

  • The client builds the full path from the current addon's folder, a slash and imageFile. The stock addon passes "Textures/LCDLogo.bmp" for the file ea_lcdkeyboard/textures/lcdlogo.bmp.
  • Any image already loaded into the element is released first.
  • If the file cannot be found or is too small to be a bitmap, the element is left without an image.
  • If no addon is current at the time of the call, nothing is loaded. The stock addon calls this function from its Initialize function.
  • With resizeToImage = false the element keeps its size.
  • resizeToImage must be a real boolean. Passing nil or a number raises an Invalid Parameters error.
  • The function needs at least four arguments and only reads the last four.

Errors

  • Error in function call 'LCDBitmapSetImage': Page '%s' does not exist.
  • Error in function call 'LCDBitmapSetImage': Page '%s' does not have a child named '%s'.
  • Error in function call 'LCDBitmapSetImage': '%s' on page '%s' is not a/an Bitmap.

Example

From ea_lcdkeyboard/source/g15test.lua:

LCDCreateBitmap( EA_LCDKeyboard.Page2, "Logo" )
LCDBitmapSetImage( EA_LCDKeyboard.Page2, "Logo", "Textures/LCDLogo.bmp", true )

See also