API:TomeSetBestiarySpeciesImage
From RoR Wiki
UI Lua API · Tome functions
Version: WAR 1.4.8
Loads the picture of a bestiary species into the texture bestiary_species_image.
TomeSetBestiarySpeciesImage(speciesId)
Arguments
- speciesId
number– Species id. The species must be unlocked.
Returns
Nothing.
Details
- The image file is taken from
interface/InterfaceCore/Tome/Bestiary/Images/, using the file name stored for the species. - The texture
bestiary_species_imageis then updated, so every window that uses it shows the new picture. The stock bestiary page has a DynamicImage withtexture="bestiary_species_image"inea_tomeofknowledge/source/tomewindow_bestiary.xml. - If the species has no picture, or the file does not exist, the texture is cleared. The stock UI checks this with
DynamicImageHasTexture. - If the id is unknown or the species is locked, the texture is cleared and an error is logged.
Errors
These are written to the UI log; the call returns normally.
Error in function call 'TomeSetBestiarySpeciesImage: You have not yet unlocked species # %d.(the quote after the function name is missing in the client's text)
Example
From ea_tomeofknowledge/source/tomewindow_bestiary.lua:
TomeSetBestiarySpeciesImage( id ) ... if( DynamicImageHasTexture( "BestiarySpeciesInfoImage" ) ) then WindowAddAnchor( "BestiarySpeciesInfoText1", "bottom", "BestiarySpeciesInfoImage", "top", 0, 10 ) else WindowAddAnchor( "BestiarySpeciesInfoText1", "top", "BestiarySpeciesInfoImage", "top", 0, 0 ) end
