- Documentation
- Client functions
- getElementPreviewCache
Function
getElementPreviewCache
Returns the path of a shot saved in the persistent preview store by setElementPreviewCacheKey. Pass the path to dxDrawImage or dxCreateTexture. The shot stays between game sessions.
Syntax
string getElementPreviewCache(string key)Arguments
keystring- The save key.
Returns
The path or false when there is no such shot.
Example
addEventHandler("onClientRender", root, function()
local img = getElementPreviewCache("salon_411")
if img then dxDrawImage(40, 40, 256, 256, img) end
end)
See also
setElementPreviewCacheKeyThe next preview shot is also saved in the persistent preview store under the given key. The store stays after leaving the game, so next time you can show the image right away withgetElementPreviewCache, without creating a preview. Saving applies to one shot; after it the key is cleared. An empty key turns saving off.getElementPreviewImageReturns the path of the preview PNG file (fordxDrawImageanddxCreateTexture) orfalsewhen there is no first shot yet.