tw.screen
Side: Client
Screen fade utilities for smooth transitions.
Functions
tw.screen.fadeOut(duration?, wait_for_completion?)
Fades the screen to black.
| Parameter | Type | Default | Description |
|---|---|---|---|
duration | integer? | 500 | Fade duration in milliseconds |
wait_for_completion | boolean? | true | If true, blocks until the fade is complete |
tw.screen.fadeIn(duration?, wait_for_completion?)
Fades the screen back in from black.
| Parameter | Type | Default | Description |
|---|---|---|---|
duration | integer? | 500 | Fade duration in milliseconds |
wait_for_completion | boolean? | false | If true, blocks until the fade is complete |
Examples
Fade out, teleport, fade in
lua
-- Fade to black (blocks by default)
tw.screen.fadeOut(800)
-- Screen is now black — do something
SetEntityCoords(PlayerPedId(), vec3(-301.62, 783.04, 117.75))
Wait(500)
-- Fade back in (non-blocking by default)
tw.screen.fadeIn(800)Quick flash transition
lua
tw.screen.fadeOut(200)
-- instant action
tw.screen.fadeIn(200)Blocking fade in
lua
tw.screen.fadeOut()
-- ... do something ...
tw.screen.fadeIn(500, true) -- wait for fade in to complete before continuing
print("Screen fully visible again")Notes
fadeOutblocks by default (wait_for_completion = true), so the code after it runs when the screen is fully black.fadeIndoes not block by default (wait_for_completion = false), so code continues immediately while the screen fades in.- Durations are in milliseconds. Default is 500ms for both functions.

