Перейти к основному содержанию

UI.FrameTexture

Object used to manipulate frame textures.

Index

Properties

readonlyCORNER_BOTTOM_LEFT

CORNER_BOTTOM_LEFT: number

Specifies bottom left corner of the frame.

readonlyCORNER_BOTTOM_RIGHT

CORNER_BOTTOM_RIGHT: number

Specifies bottom right corner of the frame.

readonlyCORNER_TOP_LEFT

CORNER_TOP_LEFT: number

Specifies top left corner of the frame.

readonlyCORNER_TOP_RIGHT

CORNER_TOP_RIGHT: number

Specifies top right corner of the frame.

readonlySIDE_BOTTOM

SIDE_BOTTOM: number

Specifies bottom side of the frame.

readonlySIDE_LEFT

SIDE_LEFT: number

Specifies left side of the frame.

readonlySIDE_RIGHT

SIDE_RIGHT: number

Specifies right side of the frame.

readonlySIDE_TOP

SIDE_TOP: number

Specifies top side of the frame.

Methods

draw

  • draw(canvas: Canvas, rect: RectF, scale: number, color: number, sides: [boolean, boolean, boolean, boolean]): void
  • Parameters

    • canvas: Canvas
    • rect: RectF
    • scale: number
    • color: number
    • sides: [boolean, boolean, boolean, boolean]

    Returns void

expand

  • expand(width: number, height: number, color: number, sides: [boolean, boolean, boolean, boolean]): Bitmap
  • expand(width: number, height: number, color: number): Bitmap
  • Expands texture to the specified side, filling the middle with specified color.


    Parameters

    • width: number
    • height: number
    • color: number

      integer color value produced by android.graphics.Color class

    • sides: [boolean, boolean, boolean, boolean]

      array of booleans marking whether the side should be expanded or not. The order of the sides is FrameTexture.SIDE_LEFT, FrameTexture.SIDE_RIGHT, FrameTexture.SIDE_UP, FrameTexture.SIDE_DOWN

    Returns Bitmap

    Expanded android.graphics.Bitmap instance with the frame.

expandAndScale

  • expandAndScale(width: number, height: number, scale: number, color: number, sides: [boolean, boolean, boolean, boolean]): Bitmap
  • expandAndScale(width: number, height: number, scale: number, color: number): Bitmap
  • Expands texture to the specified side, filling the middle with specified color.


    Parameters

    • width: number
    • height: number
    • scale: number

      scale of the created bitmap

    • color: number

      integer color value produced by android.graphics.Color class

    • sides: [boolean, boolean, boolean, boolean]

      array of booleans marking whether the side should be expanded or not. See UI.FrameTexture.expand parameters for details. Default behavior is to scale all sides

    Returns Bitmap

    Expanded and scaled android.graphics.Bitmap instance.

expandSide

  • expandSide(sideId: number, pixels: number): Bitmap
  • Expands side of the texture by specified amount of pixels.


    Parameters

    • sideId: number

      side of the texture, one of the FrameTexture.SIDE_LEFT, FrameTexture.SIDE_RIGHT, FrameTexture.SIDE_UP, FrameTexture.SIDE_DOWN constants

    • pixels: number

    Returns Bitmap

    Expanded android.graphics.Bitmap instance with the frame.

getCentralColor

  • getCentralColor(): number
  • Returns number

    Object packed integer color value of the central pixel of the source texture.

getSideSource

  • getSideSource(side: number): Bitmap
  • Parameters

    • side: number

      side of the texture, one of the FrameTexture.SIDE_LEFT, FrameTexture.SIDE_RIGHT, FrameTexture.SIDE_UP, FrameTexture.SIDE_DOWN constants

    Returns Bitmap

    Texture side source extracted from the original frame texture source stored in android.graphics.Bitmap instance.

getSource

  • Returns Bitmap

    Original frame texture source stored in android.graphics.Bitmap instance.