@rendley/sdk - v1.15.5
    Preparing search index...

    Class TextStyle

    Clip style implementation for text content, including typography, stroke, padding, and drop-shadow settings.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    Methods

    Constructors

    • Creates a text style.

      Parameters

      • options: TextClipStyleOptions

        Initial text style configuration.

      Returns TextStyle

    Properties

    backgroundColor: null | string
    color: string
    dropShadow: boolean
    dropShadowAlpha: number
    dropShadowAngle: number
    dropShadowBlur: number
    dropShadowColor: string
    dropShadowDistance: number
    fontFamily: string
    fontSize: number
    fontStyle: "normal" | "italic" | "oblique"
    fontWeight:
        | "normal"
        | "bold"
        | "bolder"
        | "lighter"
        | "100"
        | "200"
        | "300"
        | "400"
        | "500"
        | "600"
        | "700"
        | "800"
        | "900"
    letterSpacing: number
    lineHeight: number
    padding: number[]
    strokeColor: string
    strokeThickness: number
    textAlign: "left" | "center" | "right" | "justify"
    wordWrapWidth: null | number

    Methods

    • Releases any style-owned runtime mask resources.

      Returns void

      Nothing.

    • Scales the clip to fit or cover the display area.

      Parameters

      • fitStyle: FitToScreenEnum

        Strategy used to size the clip against the display.

      • center: boolean = true

        When true, centers the clip before fitting; otherwise fits relative to its current position.

      • margin: number = 0

        Extra margin, in pixels, to include in the fit calculation.

      Returns void

      Nothing.

    • Returns the temporary animation-driven fill color override.

      Returns string

      The override color string, or an empty string if no override is active.

    • Returns runtime-only crop values applied by animation.

      Returns [number, number, number, number]

      The animated crop values in [left, top, right, bottom] order.

    • Returns the runtime animation scale multipliers.

      Returns [number, number]

      The [x, y] animation scale multiplier pair.

    • Returns the optional text background color.

      Returns null | string

      The background color string, or null if none is set.

    • Returns the owning clip ID.

      Returns string

      The owning clip ID.

    • Returns the base text fill color.

      Returns string

      The text color string.

    • Returns the configured corner radii.

      Returns number[]

      The corner radii in top-left, top-right, bottom-right, bottom-left order.

    • Indicates whether corner radii are stored in relative mode.

      Returns boolean

      true if relative corner radii are enabled; otherwise false.

    • Returns the current crop values of the clip. The returned array contains four numbers: [left, top, right, bottom]

      Returns number[]

      The current crop values of the clip.

    • Indicates whether text drop shadow rendering is enabled.

      Returns boolean

      true if drop shadow rendering is enabled; otherwise false.

    • Returns the drop shadow opacity.

      Returns number

      The drop shadow opacity multiplier.

    • Returns the drop shadow angle.

      Returns number

      The drop shadow angle in radians.

    • Returns the drop shadow blur radius.

      Returns number

      The blur radius.

    • Returns the drop shadow color.

      Returns string

      The drop shadow color string.

    • Returns the drop shadow distance.

      Returns number

      The drop shadow distance in pixels.

    • Returns the preferred font family.

      Returns string

      The configured font family.

    • Returns the font size.

      Returns number

      The font size in pixels.

    • Returns the font style.

      Returns "normal" | "italic" | "oblique"

      The configured font style.

    • Returns the font weight.

      Returns
          | "normal"
          | "bold"
          | "bolder"
          | "lighter"
          | "100"
          | "200"
          | "300"
          | "400"
          | "500"
          | "600"
          | "700"
          | "800"
          | "900"

      The configured font weight.

    • Returns the text letter spacing.

      Returns number

      The letter spacing in pixels.

    • Returns the text line height.

      Returns number

      The line height in pixels.

    • Returns horizontal and vertical text padding.

      Returns number[]

      The padding pair in [horizontal, vertical] order.

    • Returns the base clip scale multipliers.

      Returns [number, number]

      The [x, y] scale pair.

    • Returns [number, number]

    • Returns the text stroke color.

      Returns string

      The stroke color string.

    • Returns the text stroke thickness.

      Returns number

      The stroke width in pixels.

    • Returns the horizontal text alignment.

      Returns "left" | "center" | "right" | "justify"

      The configured text alignment.

    • Returns the effective word-wrap width after scale is applied.

      Returns null | number

      The word-wrap width in pixels, or null if wrapping is disabled.

    • Returns [number, number]

    • Clears cached derived values so the next update fully recomputes style-dependent sprite state.

      Returns void

      Nothing.

    • Attaches a sprite instance to the style and applies the current style state to it.

      Parameters

      • sprite: TextSprite

        Sprite to control.

      Returns void

      Nothing.

    • Moves the clip to the center of the display.

      Returns void

      Nothing.

    • Rebinds the style to a different media asset ID.

      Parameters

      • mediaDataId: string

        Media asset ID associated with the clip.

      Returns void

      Nothing.

    • Scales the clip down uniformly so it fits inside the display while preserving aspect ratio.

      Returns void

      Nothing.

    • Serializes the text style.

      Returns {
          alpha: number;
          backgroundColor: null | string;
          clipId: string;
          color: string;
          cornerRadius?: [number, number, number, number];
          crop: [number, number, number, number];
          cropOffset: [number, number];
          dropShadow: boolean;
          dropShadowAlpha: number;
          dropShadowAngle: number;
          dropShadowBlur: number;
          dropShadowColor: string;
          dropShadowDistance: number;
          fontFamily: string;
          fontSize: number;
          fontStyle: "normal" | "italic" | "oblique";
          fontWeight:
              | "normal"
              | "bold"
              | "bolder"
              | "lighter"
              | "100"
              | "200"
              | "300"
              | "400"
              | "500"
              | "600"
              | "700"
              | "800"
              | "900";
          height?: number;
          letterSpacing: number;
          lineHeight: number;
          mediaDataId?: string;
          padding: number[];
          position: [number, number];
          relativeCornerRadius: boolean;
          rotation: number;
          scale: [number, number];
          strokeColor: string;
          strokeThickness: number;
          textAlign: "left" | "center" | "right" | "justify";
          width?: number;
          wordWrapWidth: null | number;
          zIndex: number;
          zoom: [number, number];
      }

      The serialized text style payload.

    • Parameters

      • alpha: number

      Returns void

    • Sets a temporary animation-driven fill color override.

      Parameters

      • color: string

        CSS-like color string. An empty string clears the override.

      Returns void

      Nothing.

    • Sets runtime-only crop values applied by animation.

      Parameters

      • left: number

        Animated crop from the left edge.

      • top: number

        Animated crop from the top edge.

      • right: number

        Animated crop from the right edge.

      • bottom: number

        Animated crop from the bottom edge.

      Returns void

      Nothing.

    • Sets runtime-only crop offset values applied by animation.

      Parameters

      • x: number

        Horizontal crop offset in pixels.

      • y: number

        Vertical crop offset in pixels.

      Returns void

      Nothing.

    • Sets runtime-only scale multipliers applied by clip animation.

      Parameters

      • multiplierX: number

        Animated horizontal scale multiplier.

      • multiplierY: number

        Animated vertical scale multiplier.

      Returns void

      Nothing.

    • Sets runtime-only zoom multipliers applied by animation.

      Parameters

      • x: number

        Horizontal zoom multiplier.

      • y: number

        Vertical zoom multiplier.

      Returns void

      Nothing.

    • Sets the optional text background color.

      Parameters

      • backgroundColor: null | string

        CSS-like color string, or null to remove the background.

      Returns void

      Nothing.

    • Updates the owning clip ID tracked by the style.

      Parameters

      • clipId: string

        Owning clip ID.

      Returns void

      Nothing.

    • Sets the base text fill color.

      Parameters

      • color: string

        CSS-like color string.

      Returns void

      Nothing.

    • Sets corner radii used to mask the clip into a rounded rectangle.

      Parameters

      • radii: number | [number, number, number, number]

        Uniform radius or individual radii for each corner.

      • relative: boolean = false

        When true, corner radii are interpreted relative to the unclipped sprite size.

      Returns void

      Nothing.

    • Sets the crop values for the clip's sprite. This will clip the original texture to the given coordinates. If the sprite is not a video, gif or image, it will not be updated. If the sprite has no texture, or the texture is not valid, it will not be updated. If updatePosition is true, it will also update the position of the sprite, so that the cropped area will maintain it's visual position.

      Parameters

      • left: number

        The left coordinate of the crop area

      • top: number

        The top coordinate of the crop area

      • right: number

        The right coordinate of the crop area

      • bottom: number

        The bottom coordinate of the crop area

      • updatePosition: boolean = true

        If true, it will also update the position of the sprite, so that the middle of the cropped area is at the same position as the middle of the original texture. Default is true.

      Returns void

    • Sets the base crop offset used when computing crop bounds.

      Parameters

      • x: number

        Horizontal crop offset in pixels.

      • y: number

        Vertical crop offset in pixels.

      Returns void

      Nothing.

    • Marks the text style as needing a full text-layout refresh on the next update.

      Returns void

      Nothing.

    • Enables or disables text drop shadow rendering.

      Parameters

      • dropShadow: boolean

        Whether the drop shadow should be rendered.

      Returns void

      Nothing.

    • Sets the drop shadow opacity.

      Parameters

      • dropShadowAlpha: number

        Drop shadow opacity multiplier.

      Returns void

      Nothing.

    • Sets the drop shadow angle in radians.

      Parameters

      • dropShadowAngle: number

        Drop shadow angle.

      Returns void

      Nothing.

    • Sets the drop shadow blur radius.

      Parameters

      • dropShadowBlur: number

        Blur radius.

      Returns void

      Nothing.

    • Sets the drop shadow color.

      Parameters

      • dropShadowColor: string

        CSS-like color string.

      Returns void

      Nothing.

    • Sets the drop shadow distance from the text glyphs.

      Parameters

      • dropShadowDistance: number

        Distance in pixels.

      Returns void

      Nothing.

    • Sets the preferred font family.

      Parameters

      • fontFamily: string

        Font family name.

      Returns void

      Nothing.

    • Sets the font size.

      Parameters

      • fontSize: number

        Font size in pixels.

      Returns void

      Nothing.

    • Sets the font style.

      Parameters

      • fontStyle: "normal" | "italic" | "oblique"

        Font style value.

      Returns void

      Nothing.

    • Sets the font weight.

      Parameters

      • fontWeight:
            | "normal"
            | "bold"
            | "bolder"
            | "lighter"
            | "100"
            | "200"
            | "300"
            | "400"
            | "500"
            | "600"
            | "700"
            | "800"
            | "900"

        Font weight value.

      Returns void

      Nothing.

    • Parameters

      • height: number

      Returns void

    • Sets the text letter spacing.

      Parameters

      • letterSpacing: number

        Letter spacing in pixels.

      Returns void

      Nothing.

    • Sets the text line height.

      Parameters

      • lineHeight: number

        Line height in pixels.

      Returns void

      Nothing.

    • Sets horizontal and vertical text padding.

      Parameters

      • padding: number | number[]

        Uniform padding value or [horizontal, vertical] padding pair.

      Returns void

      Nothing.

    • Parameters

      • x: number
      • y: number

      Returns void

    • Parameters

      • rotation: number

      Returns void

    • Sets the clip scale multipliers.

      Parameters

      • scaleX: number

        Horizontal scale multiplier.

      • scaleY: number

        Vertical scale multiplier.

      Returns void

      Nothing.

    • Parameters

      • width: number
      • height: number

      Returns void

    • Sets the text stroke color.

      Parameters

      • strokeColor: string

        CSS-like color string.

      Returns void

      Nothing.

    • Sets the text stroke thickness.

      Parameters

      • strokeThickness: number

        Stroke width in pixels.

      Returns void

      Nothing.

    • Sets horizontal text alignment.

      Parameters

      • textAlign: "left" | "center" | "right" | "justify"

        Text alignment mode.

      Returns void

      Nothing.

    • Parameters

      • width: number

      Returns void

    • Sets the word-wrap width.

      Parameters

      • wordWrapWidth: null | number

        Wrap width in pixels, or null to disable wrapping.

      Returns void

      Nothing.

    • Parameters

      • zIndex: number

      Returns void

    • Sets the base zoom multipliers used when computing crop bounds.

      Parameters

      • zoomX: number

        Horizontal zoom multiplier.

      • zoomY: number

        Vertical zoom multiplier.

      Returns void

      Nothing.

    • Applies the current style state to a sprite, including transforms, crop, and mask updates.

      Parameters

      • container: TextSprite

      Returns void

      Nothing.

    • Creates a text style instance from serialized data.

      Parameters

      • payload: object

        Serialized text style payload.

      Returns TextStyle

      The deserialized text style.