Search Results for

    Show / Hide Table of Contents

    Class Screen

    Methods to handle UI actions that affect the whole screen.

    Inheritance
    Object
    Screen
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: GTA.UI
    Assembly: ScriptHookVDotNet3.dll
    Syntax
    public static class Screen

    Fields

    | Improve this Doc View Source

    Height

    The base height of the screen used for all UI Calculations

    Declaration
    public const float Height = 720F
    Field Value
    Type Description
    Single
    | Improve this Doc View Source

    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 Source

    AreScreenKillEffectsEnabled

    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.

    | Improve this Doc View Source

    AspectRatio

    Gets the current screen aspect ratio

    Declaration
    public static float AspectRatio { get; }
    Property Value
    Type Description
    Single
    | Improve this Doc View Source

    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.

    | Improve this Doc View Source

    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.

    | Improve this Doc View Source

    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.

    | Improve this Doc View Source

    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.

    | Improve this Doc View Source

    IsHelpTextDisplayed

    Gets a value indicating whether a help message is currently displayed.

    Declaration
    public static bool IsHelpTextDisplayed { get; }
    Property Value
    Type Description
    Boolean
    | Improve this Doc View Source

    Resolution

    Gets the actual screen resolution the game is being rendered at

    Declaration
    public static Size Resolution { get; }
    Property Value
    Type Description
    Size
    | Improve this Doc View Source

    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 Source

    FadeIn(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

    | Improve this Doc View Source

    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

    | Improve this Doc View Source

    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.

    | Improve this Doc View Source

    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.

    | Improve this Doc View Source

    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.

    | Improve this Doc View Source

    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

    | Improve this Doc View Source

    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.

    | Improve this Doc View Source

    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.

    | Improve this Doc View Source

    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.

    | Improve this Doc View Source

    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.

    | Improve this Doc View Source

    StopEffects()

    Stops all currently running effects.

    Declaration
    public static void StopEffects()
    | Improve this Doc View Source

    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
    • Improve this Doc
    • View Source
    In This Article
    Back to top Generated by DocFX