API:LCDBitmapSetImage
From RoR Wiki
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–trueto 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 fileea_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
Initializefunction. - With
resizeToImage = falsethe element keeps its size. resizeToImagemust be a real boolean. Passingnilor 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 )
