ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Client functions
  3. setElementPreviewCacheKey

Function

setElementPreviewCacheKey

ClientGame engineTrilogy Hub only

The 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 with getElementPreviewCache, without creating a preview. Saving applies to one shot; after it the key is cleared. An empty key turns saving off.

Syntax

bool setElementPreviewCacheKey(preview preview, string key)

Arguments

previewpreview
The preview.
keystring
Key: letters, digits, _ and -, up to 64 characters.

Returns

true on success, false on a bad key or preview.

Example

local veh = createVehicle(411, 0, 0, -50)
local preview = createElementPreview(veh, 256, 256)
setElementPreviewCacheKey(preview, "salon_411")

Notes

Shared store. The preview store is one for all servers, so use keys with your resource name, e.g. "salon_411".

See also