- Documentation
- Client functions
- setPostEffect
Function
setPostEffect
Sets an image effect for this player, computed by the game engine over the whole world image (without script texts and windows). The effect stays until resetPostEffect or leaving the server. Available effects: "saturation" (0-2, 1 = unchanged, 0 = black and white), "contrast" (0-2), "gamma" (0.1-4), "gain" (colour brightness gain, 0-4), "offset" (colour offset, -1-1, 0 = unchanged), "tint" (image tint: r, g, b 0-255), "temperature" (white temperature in kelvins, 1500-15000, 6500 = neutral), "grain" (grain 0-1), "grainJitter" (grain jitter 0-1), "vignette" (darkened edges 0-1), "bloom" (glow of bright areas 0-8), "fringe" (colour fringing at the edges 0-5), "exposure" (-8-8, 0 = unchanged, +1 = twice as bright).
Syntax
bool setPostEffect(string name, float value)Arguments
namestring- The effect name.
valuefloat- The effect value. For
"saturation","contrast","gamma","gain"and"offset"one number changes the whole image, and three or four (r, g, b[, overall]) each colour separately. For"tint"three numbers r, g, b.
Returns
true on success, false for an unknown effect or a value out of range.
Example
-- wspomnienie: czarno-bialy obraz z ziarnem i ciemnymi brzegami
setPostEffect("saturation", 0)
setPostEffect("grain", 0.4)
setPostEffect("vignette", 0.8)
setTimer(resetPostEffects, 10000, 1)
Notes
Depends on the player's graphics. At the lowest effects (post-process) quality the game does not draw grain or darkened edges. The other effects always work.
See also
getPostEffectReturns the value of an image effect set withsetPostEffector by the server (the colour filter as"tint", grain as"grain").resetPostEffectRemoves one image effect set withsetPostEffect. If the server also sets this effect (colour filter, grain), the server value comes back.resetPostEffectsRemoves all image effects set withsetPostEffectin this game.getPostEffectNamesReturns the list of image effect names accepted bysetPostEffect.setColorFilterApplies a colour filter to the game image: two RGBA layers multiply the colours of the world, each to the degree of its alpha (alpha 0 = the layer changes nothing, 255 = the full layer colour). On the server every player gets the filter, on the client only this player (it takes priority over the server filter). Script texts and windows are not tinted.