visibleRect Class
Module: _decorator Parent Module: cc
cc.visibleRect is a singleton object which defines the actual visible rect of the current view, it should represent the same rect as cc.view.getViewportRect()
Index
Properties
- topLeft- Vec2Top left coordinate of the screen related to the game scene.
- topRight- Vec2Top right coordinate of the screen related to the game scene.
- top- Vec2Top center coordinate of the screen related to the game scene.
- bottomLeft- Vec2Bottom left coordinate of the screen related to the game scene.
- bottomRight- Vec2Bottom right coordinate of the screen related to the game scene.
- bottom- Vec2Bottom center coordinate of the screen related to the game scene.
- center- Vec2Center coordinate of the screen related to the game scene.
- left- Vec2Left center coordinate of the screen related to the game scene.
- right- Vec2Right center coordinate of the screen related to the game scene.
- width- NumberWidth of the screen.
- height- NumberHeight of the screen.
Methods
- initinitialize
Details
Properties
topLeft
Top left coordinate of the screen related to the game scene.
| meta | description | 
|---|---|
| Type | Vec2 | 
| Defined in | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCVisibleRect.js:93 | 
topRight
Top right coordinate of the screen related to the game scene.
| meta | description | 
|---|---|
| Type | Vec2 | 
| Defined in | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCVisibleRect.js:98 | 
top
Top center coordinate of the screen related to the game scene.
| meta | description | 
|---|---|
| Type | Vec2 | 
| Defined in | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCVisibleRect.js:103 | 
bottomLeft
Bottom left coordinate of the screen related to the game scene.
| meta | description | 
|---|---|
| Type | Vec2 | 
| Defined in | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCVisibleRect.js:108 | 
bottomRight
Bottom right coordinate of the screen related to the game scene.
| meta | description | 
|---|---|
| Type | Vec2 | 
| Defined in | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCVisibleRect.js:113 | 
bottom
Bottom center coordinate of the screen related to the game scene.
| meta | description | 
|---|---|
| Type | Vec2 | 
| Defined in | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCVisibleRect.js:118 | 
center
Center coordinate of the screen related to the game scene.
| meta | description | 
|---|---|
| Type | Vec2 | 
| Defined in | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCVisibleRect.js:123 | 
left
Left center coordinate of the screen related to the game scene.
| meta | description | 
|---|---|
| Type | Vec2 | 
| Defined in | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCVisibleRect.js:128 | 
right
Right center coordinate of the screen related to the game scene.
| meta | description | 
|---|---|
| Type | Vec2 | 
| Defined in | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCVisibleRect.js:133 | 
width
Width of the screen.
| meta | description | 
|---|---|
| Type | Number | 
| Defined in | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCVisibleRect.js:138 | 
height
Height of the screen.
| meta | description | 
|---|---|
| Type | Number | 
| Defined in | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCVisibleRect.js:143 | 
Methods
init
initialize
| meta | description | 
|---|---|
| Defined in | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCVisibleRect.js:49 | 
Parameters
- visibleRectRect
