Phaser. RoundedRectangle

new RoundedRectangle(x, y, width, height, radius)

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

Parameters:
Name Type Argument Default Description
x number <optional>
0

The x coordinate of the top-left corner of the Rectangle.

y number <optional>
0

The y coordinate of the top-left corner of the Rectangle.

width number <optional>
0

The width of the Rectangle. Should always be either zero or a positive value.

height number <optional>
0

The height of the Rectangle. Should always be either zero or a positive value.

radius number <optional>
20

Controls the radius of the rounded corners.

Source - geom/RoundedRectangle.js, line 20

Members

height :number

The height of the Rectangle. This value should never be set to a negative.

Source - geom/RoundedRectangle.js, line 46

radius :number

The radius of the rounded corners.

Source - geom/RoundedRectangle.js, line 51

<readonly> type :number

The const type of this object.

Source - geom/RoundedRectangle.js, line 57

width :number

The width of the Rectangle. This value should never be set to a negative.

Source - geom/RoundedRectangle.js, line 41

x :number

The x coordinate of the top-left corner of the Rectangle.

Source - geom/RoundedRectangle.js, line 31

y :number

The y coordinate of the top-left corner of the Rectangle.

Source - geom/RoundedRectangle.js, line 36

Methods

clone() → {Phaser.RoundedRectangle}

Returns a new RoundedRectangle object with the same values for the x, y, width, height and radius properties as this RoundedRectangle object.

Returns:
Source - geom/RoundedRectangle.js, line 62

contains(x, y) → {boolean}

Determines whether the specified coordinates are contained within the region defined by this Rounded Rectangle object.

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:
boolean -

A value of true if the RoundedRectangle Rectangle object contains the specified point; otherwise false.

Source - geom/RoundedRectangle.js, line 75
Phaser Copyright © 2012-2015 Photon Storm Ltd.
Documentation generated by JSDoc 3.3.2 on Thu Feb 18 2016 14:41:06 GMT+0000 (GMT Standard Time) using the DocStrap template.

快捷菜单

注意:只有登录才能全文翻译,每个新用户赠送300会员币。
赚取方法:文章评论+1000,分享网站截图给站长+3000,另充10元+100万会员币
支持一下记得截图给站长!

VIP限时免费阅读!登录可得1万币尽情中文阅读!


记得CTRL+D收藏!
站长微信:
支持自学php网
如有问题,记得强刷一下.

  • height :number - 属性
  • radius :number - 属性
  • type :number - 属性
  • width :number - 属性
  • x :number - 属性
  • y :number - 属性
  • clone() → {Phaser.RoundedRectangle} - 方法
  • contains(x, y) → {boolean} - 方法