PIXI.RoundedRectangle

class RoundedRectangle

The Rounded Rectangle object is an area that has nice rounded corners, as indicated by its top-left corner point (x, y) and by its width and its height and its radius.

Constructor


new PIXI.RoundedRectangle(x: number, y: number, width: number, height: number, radius: number) → {}
Parameters:
Name Type Default Description
x number 0

The X coordinate of the upper-left corner of the rounded rectangle

y number 0

The Y coordinate of the upper-left corner of the rounded rectangle

width number 0

The overall width of this rounded rectangle

height number 0

The overall height of this rounded rectangle

radius number 20

Controls the radius of the rounded corners

Summary


Properties from RoundedRectangle

number
height = 0
number
radius = 20
SHAPES.RREC
type = PIXI.SHAPES.RREC
number
width = 0
number
x = 0
number
y = 0

Methods from RoundedRectangle

Public Properties


height RoundedRectangle.ts:19
height: number = 0
radius RoundedRectangle.ts:22
radius: number = 20
type RoundedRectangle.ts:25
type: SHAPES.RREC = PIXI.SHAPES.RREC

The type of the object, mainly used to avoid instanceof checks

See: PIXI.SHAPES
width RoundedRectangle.ts:16
width: number = 0

Public Methods


clone RoundedRectangle.ts:49
clone() → {PIXI.RoundedRectangle}

Creates a clone of this Rounded Rectangle.

Returns:
Type Description
PIXI.RoundedRectangle
  • A copy of the rounded rectangle.
contains RoundedRectangle.ts:58
contains(x: number, y: number) → {boolean}

Checks whether the x and y coordinates given are contained within this Rounded Rectangle

Parameters:
Name Type Description
x number

The X coordinate of the point to test.

y number

The Y coordinate of the point to test.

Returns:
Type Description
boolean
  • Whether the x/y coordinates are within this Rounded Rectangle.

Powered by webdoc!