Preparing search index...

    Rounded Rectangle Component Gives a Rounded Rectangle at a given size Provides Background Color, Gradient or Texture And an Optional Inset Border, with Color or Gradient

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    api: Record<string, any>

    Generic object accessible by other instances of ScriptComponent. Use this object to store references to properties and methods that need to be accessible from other ScriptComponents.

    This property is no longer needed, you can use a reference to the ScriptComponent, including 'script', directly

    enabled: boolean

    If disabled, the Component will stop enacting its behavior.

    isEnabledInHierarchy: boolean

    Returns true if this Component, its SceneObject, and all of that SceneObjects parents are enabled.

    name: string
    sceneObject: SceneObject

    The SceneObject this component is on.

    uniqueIdentifier: string
    updatePriority: number

    Accessors

    • get backgroundColor(): vec4

      Returns vec4

      vec4 of current background color. for solid color, not gradient.

    • set backgroundColor(color: vec4): void

      Parameters

      • color: vec4

        set current solid background color.

      Returns void

    • get border(): boolean

      Returns boolean

      boolean whether or not the border is enabled.

    • set border(enabled: boolean): void

      Parameters

      • enabled: boolean

        boolean to show or hide the border.

      Returns void

    • get borderColor(): vec4

      Returns vec4

      vec4 of the solid border color (not gradient).

    • set borderColor(color: vec4): void

      Parameters

      • color: vec4

        set vec4 of the solid border color (not gradient).

      Returns void

    • get borderGradientEndPosition(): vec2

      Returns vec2

      vec2 of current border gradient end position. The end position defines the range for the stops.

    • set borderGradientEndPosition(position: vec2): void

      Parameters

      • position: vec2

        set vec2 of the border gradient end position. The end position defines the range for the stops.

      Returns void

    • get borderGradientStartPosition(): vec2

      Returns vec2

      vec2 of current border gradient start position. The start position defines the range for the stops.

    • set borderGradientStartPosition(position: vec2): void

      Parameters

      • position: vec2

        set vec2 of the border gradient start position. The start position defines the range for the stops.

      Returns void

    • get borderGradientType(): GradientType

      Returns GradientType

      type of gradient for the border gradient: Linear or Radial.

    • set borderGradientType(type: GradientType): void

      Parameters

      • type: GradientType

        set type of gradient for the border gradient: Linear or Gradient.

      Returns void

    • get borderSize(): number

      Returns number

      current border thickness in centimeters in local space.

    • set borderSize(borderSize: number): void

      Parameters

      • borderSize: number

        set border thickness in centimeters in local space.

      Returns void

    • get borderType(): BorderType

      Returns BorderType

      which type of border: either Color or Gradient.

    • set borderType(type: BorderType): void

      Parameters

      • type: BorderType

        set border type: either Color or Gradient.

      Returns void

    • get cornerRadius(): number

      Returns number

      current corner radius in centimeters in local space.

    • set cornerRadius(cornerRadius: number): void

      Parameters

      • cornerRadius: number

        set corner radius in centimeters in local space.

      Returns void

    • get gradient(): boolean

      Returns boolean

      boolean of whether or not the background uses a gradient.

    • set gradient(enabled: boolean): void

      Parameters

      • enabled: boolean

        boolean to enable or disable background gradient.

      Returns void

    • get gradientEndPosition(): vec2

      Returns vec2

      vec2 of the background ending position. The end position defines the range for the stops.

    • set gradientEndPosition(position: vec2): void

      Parameters

      • position: vec2

        set vec2 of the background ending position. The end position defines the range for the stops.

      Returns void

    • get gradientStartPosition(): vec2

      Returns vec2

      vec2 of the background starting position. The start position defines the range for the stops.

    • set gradientStartPosition(position: vec2): void

      Parameters

      • position: vec2

        set vec2 of the background starting position. The start position defines the range for the stops.

      Returns void

    • get gradientType(): GradientType

      Returns GradientType

      type of the background gradient: Linear, or Radial.

    • set gradientType(type: GradientType): void

      Parameters

      • type: GradientType

        set type of the background gradient: Linear or Radial.

      Returns void

    • get material(): Material

      Get Material asset that is cloned on initialize

      Returns Material

    • set material(material: Material): void

      Set Material asset that is cloned on initialize

      Parameters

      Returns void

    • get renderOrder(): number

      The render order of the Rounded Rectangle.

      Returns number

    • set renderOrder(value: number): void

      The render order of the Rounded Rectangle.

      Parameters

      • value: number

      Returns void

    • get size(): vec2

      Returns vec2

      vec2 size of the rectangle in centimeters in local space.

    • set size(size: vec2): void

      Parameters

      • size: vec2

        set the rectangle to this size in centimeters in local space.

      Returns void

    • get texture(): Texture

      Returns Texture

      current background texture asset.

    • set texture(texture: Texture): void

      Parameters

      • texture: Texture

        set asset for background texture.

      Returns void

    • get textureMode(): TextureMode

      Returns TextureMode

      current texture mode of background texture: Stretch, Fill Height or Fill Width.

    • set textureMode(mode: TextureMode): void

      Parameters

      • mode: TextureMode

        set texture mode of background texture: Stretch: Fill Height or Fill Width.

      Returns void

    • get textureWrap(): TextureWrap

      Returns TextureWrap

      current texture wrap method: None, Repeat or Clamp.

    • set textureWrap(wrap: TextureWrap): void

      Parameters

      • wrap: TextureWrap

        sets current texture wrap method: None, Repeat or Clamp.

      Returns void

    • get useTexture(): boolean

      Returns boolean

      boolean of whether this uses a background texture.

    • set useTexture(use: boolean): void

      Parameters

      • use: boolean

        boolean of whether to use a background texture.

      Returns void

    Methods

    • get a stop from the background gradient at index

      Parameters

      • index: number

      Returns GradientStop

      GradientStop

    • get a stop from the border gradient at index

      Parameters

      • index: number

      Returns GradientStop

      GradientStop

    • initialize function run once if creating dynamically: set parameters, then run this function to create and initialize in one frame

      Returns void

    • Returns true if the object matches or derives from the passed in type.

      Parameters

      • type: string

      Returns boolean

    • Returns void

    • Prints the current configuration of the RoundedRectangle to the console in a readable format. Useful for debugging and understanding the current state.

      Returns void

    • set background gradient using a GradientParameters input

      Parameters

      Returns void

    • set a stop in the background gradient at given index, with parameters defined by GradientStop

      Parameters

      Returns void

    • set background gradient using a GradientParameters input

      Parameters

      Returns void

    • set a stop in the border gradient at given index, with parameters defined by GradientStop

      Parameters

      Returns void