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

    Class ShapeStyle

    Clip style implementation for vector shapes, including fill, stroke, and shape-specific geometry settings.

    Hierarchy (View Summary)

    Index

    Constructors

    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 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 Bezier control nodes used for Bezier path shapes.

      Returns (null | ShapeBezierNode)[]

      The configured Bezier nodes.

    • Returns the owning clip ID.

      Returns string

      The owning clip ID.

    • 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.

    • Returns the fill color used to render the shape.

      Returns string

      The fill color string.

    • Indicates whether the shape interior is filled.

      Returns boolean

      true if fill rendering is enabled; otherwise false.

    • Returns the inner radius used for the star shape.

      Returns number

      The inner radius in pixels.

    • Returns the number of points used for the star shape.

      Returns number

      The number of star points.

    • Returns the outer radius used for the star shape.

      Returns number

      The outer radius in pixels.

    • Returns the polygon point list used for polygon-based shapes.

      Returns (null | ShapePoint)[]

      The configured polygon points.

    • Returns the corner radius used for rounded rectangles.

      Returns number

      The corner radius in pixels.

    • Returns the base clip scale multipliers.

      Returns [number, number]

      The [x, y] scale pair.

    • Returns [number, number]

    • Returns the stroke alignment used by the vector graphics renderer.

      Returns number

      The stroke alignment value.

    • Returns the outline opacity.

      Returns number

      The outline opacity multiplier.

    • Returns the stroke color used to render the shape outline.

      Returns string

      The stroke color string.

    • Returns the shape outline width.

      Returns number

      The outline width in pixels.

    • 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: ShapeSprite

        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 shape style.

      Returns {
          alpha: number;
          bezierNodes?: (
              | null
              | {
                  controlPoint1: { x: number; y: number };
                  controlPoint2: { x: number; y: number };
                  point: { x: number; y: number };
              }
          )[];
          clipId: string;
          cornerRadius?: [number, number, number, number];
          crop: [number, number, number, number];
          cropOffset: [number, number];
          fillColor?: string;
          hasFill: boolean;
          height?: number;
          innerRadius?: number;
          mediaDataId?: string;
          nrPoints?: number;
          outerRadius?: number;
          points?: (null | { x: number; y: number })[];
          position: [number, number];
          rectRadius?: number;
          relativeCornerRadius: boolean;
          rotation: number;
          scale: [number, number];
          shape: ShapeTypeEnum;
          strokeAlignment?: number;
          strokeAlpha?: number;
          strokeColor?: string;
          strokeWidth?: number;
          width?: number;
          zIndex: number;
          zoom: [number, number];
      }

      The serialized shape style payload.

    • Parameters

      • alpha: number

      Returns void

    • 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 Bezier control nodes used for Bezier path shapes.

      Parameters

      • bezierNodes: (null | ShapeBezierNode)[]

        Bezier node list, with null entries preserved for serialized compatibility.

      Returns void

      Nothing.

    • Updates the owning clip ID tracked by the style.

      Parameters

      • clipId: string

        Owning clip ID.

      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.

    • Sets the fill color used to render the shape.

      Parameters

      • fillColor: string

        CSS-like color string.

      Returns void

      Nothing.

    • Enables or disables filling the interior of the shape.

      Parameters

      • hasFill: boolean

        Whether the shape should be filled.

      Returns void

      Nothing.

    • Parameters

      • height: number

      Returns void

    • Sets the inner radius used when rendering a star shape.

      Parameters

      • innerRadius: number

        Inner radius in pixels.

      Returns void

      Nothing.

    • Sets the number of points used when rendering a star shape.

      Parameters

      • nrPoints: number

        Number of star points.

      Returns void

      Nothing.

    • Sets the outer radius used when rendering a star shape.

      Parameters

      • outerRadius: number

        Outer radius in pixels.

      Returns void

      Nothing.

    • Sets the polygon point list used for polygon-based shapes.

      Parameters

      • points: (null | ShapePoint)[]

        Polygon points, with null entries preserved for serialized compatibility.

      Returns void

      Nothing.

    • Parameters

      • x: number
      • y: number

      Returns void

    • Sets the corner radius used when rendering rounded rectangles.

      Parameters

      • rectRadius: number

        Corner radius in pixels.

      Returns void

      Nothing.

    • Parameters

      • rotation: number

      Returns void

    • Sets the clip scale multipliers.

      Parameters

      • scaleX: number

        Horizontal scale multiplier.

      • scaleY: number

        Vertical scale multiplier.

      Returns void

      Nothing.

    • Sets the shape primitive type rendered by the clip.

      Parameters

      Returns void

      Nothing.

    • Parameters

      • width: number
      • height: number

      Returns void

    • Sets the outline opacity.

      Parameters

      • strokeAlpha: number

        Outline opacity multiplier.

      Returns void

      Nothing.

    • Sets the stroke color used to render the shape outline.

      Parameters

      • strokeColor: string

        CSS-like color string.

      Returns void

      Nothing.

    • Sets the shape outline width.

      Parameters

      • strokeWidth: number

        Outline width in pixels.

      Returns void

      Nothing.

    • Parameters

      • width: number

      Returns void

    • 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: ShapeSprite
      • redraw: boolean = false

      Returns void

      Nothing.

    • Creates a shape style instance from serialized data.

      Parameters

      • payload: object

        Serialized shape style payload.

      Returns ShapeStyle

      The deserialized shape style.