Class Screen
Methods to handle UI actions that affect the whole screen.
Inherited Members
Namespace: GTA.UI
Assembly: ScriptHookVDotNet3.dll
Syntax
public static class Screen
Fields
| Improve this Doc View SourceHeight
The base height of the screen used for all UI Calculations
Declaration
public const float Height = 720F
Field Value
Type | Description |
---|---|
Single |
Width
The base width of the screen used for all UI Calculations, unless ScaledDraw is used
Declaration
public const float Width = 1280F
Field Value
Type | Description |
---|---|
Single |
Properties
| Improve this Doc View SourceAreScreenKillEffectsEnabled
Gets a value indicating whether screen kill effects are enabled.
Declaration
public static bool AreScreenKillEffectsEnabled { get; }
Property Value
Type | Description |
---|---|
Boolean | true if screen kill effects are enabled; otherwise, false. |
AspectRatio
Gets the current screen aspect ratio
Declaration
public static float AspectRatio { get; }
Property Value
Type | Description |
---|---|
Single |
IsFadedIn
Gets a value indicating whether the screen is faded in.
Declaration
public static bool IsFadedIn { get; }
Property Value
Type | Description |
---|---|
Boolean | true if the screen is faded in; otherwise, false. |
IsFadedOut
Gets a value indicating whether the screen is faded out.
Declaration
public static bool IsFadedOut { get; }
Property Value
Type | Description |
---|---|
Boolean | true if the screen is faded out; otherwise, false. |
IsFadingIn
Gets a value indicating whether the screen is fading in.
Declaration
public static bool IsFadingIn { get; }
Property Value
Type | Description |
---|---|
Boolean | true if the screen is fading in; otherwise, false. |
IsFadingOut
Gets a value indicating whether the screen is fading out.
Declaration
public static bool IsFadingOut { get; }
Property Value
Type | Description |
---|---|
Boolean | true if the screen is fading out; otherwise, false. |
IsHelpTextDisplayed
Gets a value indicating whether a help message is currently displayed.
Declaration
public static bool IsHelpTextDisplayed { get; }
Property Value
Type | Description |
---|---|
Boolean |
Resolution
Gets the actual screen resolution the game is being rendered at
Declaration
public static Size Resolution { get; }
Property Value
Type | Description |
---|---|
Size |
ScaledWidth
Gets the screen width scaled against a 720pixel height base.
Declaration
public static float ScaledWidth { get; }
Property Value
Type | Description |
---|---|
Single |
Methods
| Improve this Doc View SourceFadeIn(Int32)
Fades the screen in over a specific time, useful for transitioning
Declaration
public static void FadeIn(int time)
Parameters
Type | Name | Description |
---|---|---|
Int32 | time | The time for the fade in to take |
FadeOut(Int32)
Fades the screen out over a specific time, useful for transitioning
Declaration
public static void FadeOut(int time)
Parameters
Type | Name | Description |
---|---|---|
Int32 | time | The time for the fade out to take |
IsEffectActive(ScreenEffect)
Gets a value indicating whether the specific screen effect is running.
Declaration
public static bool IsEffectActive(ScreenEffect effectName)
Parameters
Type | Name | Description |
---|---|---|
ScreenEffect | effectName | The ScreenEffect to check. |
Returns
Type | Description |
---|---|
Boolean | true if the screen effect is active; otherwise, false. |
ShowHelpText(String, Int32, Boolean, Boolean)
Displays a help message in the top corner of the screen infinitely.
Declaration
public static void ShowHelpText(string helpText, int duration = -1, bool beep = true, bool looped = false)
Parameters
Type | Name | Description |
---|---|---|
String | helpText | The text to display. |
Int32 | duration | The duration how long the help text will be displayed in real time (not in game time which is influenced by game speed). if the value is not positive, the help text will be displayed for 7.5 seconds. |
Boolean | beep | Whether to play beeping sound. |
Boolean | looped | Whether to show this help message forever. |
ShowHelpTextThisFrame(String)
Displays a help message in the top corner of the screen this frame. Beeping sound will be played.
Declaration
public static void ShowHelpTextThisFrame(string helpText)
Parameters
Type | Name | Description |
---|---|---|
String | helpText | The text to display. |
ShowHelpTextThisFrame(String, Boolean)
Displays a help message in the top corner of the screen this frame. Specify whether beeping sound plays.
Declaration
public static void ShowHelpTextThisFrame(string helpText, bool beep)
Parameters
Type | Name | Description |
---|---|---|
String | helpText | The text to display. |
Boolean | beep | Whether to play beeping sound |
ShowSubtitle(String, Int32)
Shows a subtitle at the bottom of the screen for a given time
Declaration
public static void ShowSubtitle(string message, int duration = 2500)
Parameters
Type | Name | Description |
---|---|---|
String | message | The message to display. |
Int32 | duration | The duration to display the subtitle in milliseconds. |
ShowSubtitle(String, Int32, Boolean)
Shows a subtitle at the bottom of the screen for a given time
Declaration
public static void ShowSubtitle(string message, int duration, bool drawImmediately = true)
Parameters
Type | Name | Description |
---|---|---|
String | message | The message to display. |
Int32 | duration | The duration to display the subtitle in milliseconds. |
Boolean | drawImmediately | Whether to draw immediately or draw after all the queued subtitles have finished. |
StartEffect(ScreenEffect, Int32, Boolean)
Starts applying the specified effect to the screen.
Declaration
public static void StartEffect(ScreenEffect effectName, int duration = 0, bool looped = false)
Parameters
Type | Name | Description |
---|---|---|
ScreenEffect | effectName | The ScreenEffect to start playing. |
Int32 | duration | The duration of the effect in milliseconds or zero to use the default length. |
Boolean | looped | If true the effect won't stop until StopEffect(ScreenEffect) is called. |
StopEffect(ScreenEffect)
Stops applying the specified effect to the screen.
Declaration
public static void StopEffect(ScreenEffect effectName)
Parameters
Type | Name | Description |
---|---|---|
ScreenEffect | effectName | The ScreenEffect to stop playing. |
StopEffects()
Stops all currently running effects.
Declaration
public static void StopEffects()
WorldToScreen(Vector3, Boolean)
Translates a point in WorldSpace to its given Coordinates on the Screen
Declaration
public static PointF WorldToScreen(Vector3 position, bool scaleWidth = false)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | position | The position in the World. |
Boolean | scaleWidth | if set to true Returns the screen position scaled by ScaledWidth; otherwise, returns the screen position scaled by Width. |
Returns
Type | Description |
---|---|
PointF |