-
AssetDB Modules
properties
methods
- explore
- exploreLib
- queryPathByUrl
- queryUuidByUrl
- queryPathByUuid
- queryUrlByUuid
- queryInfoByUuid
- queryMetaInfoByUuid
- deepQuery
- queryAssets
- import
- create
- move
- delete
- save
- saveMeta
- urlToUuid
- fspathToUuid
- uuidToFspath
- uuidToUrl
- exists
- existsByUuid
- existsByPath
- isSubAsset
- isSubAssetByUuid
- isSubAssetByPath
- containsSubAssets
- containsSubAssetsByUuid
- containsSubAssetsByPath
- assetInfo
- assetInfoByUuid
- assetInfoByPath
- subAssetInfos
- subAssetInfosByUuid
- subAssetInfosByPath
- loadMeta
- loadMetaByUuid
- loadMetaByPath
- isMount
- isMountByPath
- isMountByUuid
- mountInfo
- mountInfoByUuid
- mountInfoByPath
- mount
- unmount
-
Editor Modules
properties
methods
- log
- success
- failed
- info
- warn
- error
- fatal
- connectToConsole
- clearLog
- loadProfile
- loadAllPackages
- require
- execSpawn
- watchPackages
- registerProfilePath
- registerDefaultLayout
- init
- reset
- sendToWindowsExclude
- sendToWindows
- sendToCore
- sendToAll
- sendToPanel
- sendToMainWindow
- url
- registerProtocol
- require
- log
- sendToCoreSync
- sendToCore
- sendToWindows
- sendToMainWindow
- sendToAll
- sendToPanel
- sendRequestToCore
- cancelRequestToCore
- waitForReply
- cancelWaitForReply
-
Editor.Debugger Modules
-
Editor.MainMenu Modules
-
Editor.Package Modules
properties
methods
-
Editor.Panel Modules
methods
-
cc Modules
properties
- PRIORITY_NON_SYSTEM
- FMT_JPG
- FMT_PNG
- FMT_TIFF
- FMT_RAWDATA
- FMT_WEBP
- FMT_UNKNOWN
- FIX_ARTIFACTS_BY_STRECHING_TEXEL
- DIRECTOR_STATS_POSITION
- DIRECTOR_FPS_INTERVAL
- COCOSNODE_RENDER_SUBPIXEL
- SPRITEBATCHNODE_RENDER_SUBPIXEL
- AUTO_PREMULTIPLIED_ALPHA_FOR_PNG
- OPTIMIZE_BLEND_FUNC_FOR_PREMULTIPLIED_ALPHA
- TEXTURE_ATLAS_USE_TRIANGLE_STRIP
- TEXTURE_ATLAS_USE_VAO
- RETINA_DISPLAY_FILENAME_SUFFIX
- USE_LA88_LABELS
- SPRITE_DEBUG_DRAW
- SPRITEBATCHNODE_DEBUG_DRAW
- LABELBMFONT_DEBUG_DRAW
- LABELATLAS_DEBUG_DRAW
- IS_RETINA_DISPLAY_SUPPORTED
- DEFAULT_ENGINE
- ENABLE_STACKABLE_ACTIONS
- ENABLE_GL_STATE_CACHE
- INVALID_INDEX
- PI
- FLT_MAX
- FLT_MIN
- RAD
- DEG
- UINT_MAX
- REPEAT_FOREVER
- FLT_EPSILON
- ONE
- ZERO
- SRC_ALPHA
- SRC_ALPHA_SATURATE
- SRC_COLOR
- DST_ALPHA
- DST_COLOR
- ONE_MINUS_SRC_ALPHA
- ONE_MINUS_SRC_COLOR
- ONE_MINUS_DST_ALPHA
- ONE_MINUS_DST_COLOR
- ONE_MINUS_CONSTANT_ALPHA
- ONE_MINUS_CONSTANT_COLOR
- LINEAR
- BLEND_SRC
- BLEND_DST
- DEVICE_ORIENTATION_PORTRAIT
- DEVICE_ORIENTATION_LANDSCAPE_LEFT
- DEVICE_ORIENTATION_PORTRAIT_UPSIDE_DOWN
- DEVICE_ORIENTATION_LANDSCAPE_RIGHT
- DEVICE_MAX_ORIENTATIONS
- VERTEX_ATTRIB_FLAG_NONE
- VERTEX_ATTRIB_FLAG_POSITION
- VERTEX_ATTRIB_FLAG_COLOR
- VERTEX_ATTRIB_FLAG_TEX_COORDS
- VERTEX_ATTRIB_FLAG_POS_COLOR_TEX
- GL_ALL
- VERTEX_ATTRIB_POSITION
- VERTEX_ATTRIB_COLOR
- VERTEX_ATTRIB_TEX_COORDS
- VERTEX_ATTRIB_MAX
- UNIFORM_PMATRIX
- UNIFORM_MVMATRIX
- UNIFORM_MVPMATRIX
- UNIFORM_TIME
- UNIFORM_SINTIME
- UNIFORM_COSTIME
- UNIFORM_RANDOM01
- UNIFORM_SAMPLER
- UNIFORM_MAX
- SHADER_POSITION_TEXTURECOLOR
- SHADER_POSITION_TEXTURECOLORALPHATEST
- SHADER_POSITION_COLOR
- SHADER_POSITION_TEXTURE
- SHADER_POSITION_TEXTURE_UCOLOR
- SHADER_POSITION_TEXTUREA8COLOR
- SHADER_POSITION_UCOLOR
- SHADER_POSITION_LENGTHTEXTURECOLOR
- UNIFORM_PMATRIX_S
- UNIFORM_MVMATRIX_S
- UNIFORM_MVPMATRIX_S
- UNIFORM_TIME_S
- UNIFORM_SINTIME_S
- UNIFORM_COSTIME_S
- UNIFORM_RANDOM01_S
- UNIFORM_SAMPLER_S
- UNIFORM_ALPHA_TEST_VALUE_S
- ATTRIBUTE_NAME_COLOR
- ATTRIBUTE_NAME_POSITION
- ATTRIBUTE_NAME_TEX_COORD
- ITEM_SIZE
- CURRENT_ITEM
- ZOOM_ACTION_TAG
- NORMAL_TAG
- SELECTED_TAG
- DISABLE_TAG
methods
- _initDebugSetting
- error
- warn
- log
- info
- speed
- follow
- cardinalSplineTo
- cardinalSplineBy
- catmullRomTo
- catmullRomBy
- easeIn
- easeOut
- easeInOut
- easeExponentialIn
- easeExponentialOut
- easeExponentialInOut
- easeSineIn
- easeSineOut
- easeSineInOut
- easeElasticIn
- easeElasticOut
- easeElasticInOut
- easeBounceIn
- easeBounceOut
- easeBounceInOut
- easeBackIn
- easeBackOut
- easeBackInOut
- easeBezierAction
- easeQuadraticActionIn
- easeQuadraticActionOut
- easeQuadraticActionInOut
- easeQuarticActionIn
- easeQuarticActionOut
- easeQuarticActionInOut
- easeQuinticActionIn
- easeQuinticActionOut
- easeQuinticActionInOut
- easeCircleActionIn
- easeCircleActionOut
- easeCircleActionInOut
- easeCubicActionIn
- easeCubicActionOut
- easeCubicActionInOut
- show
- hide
- toggleVisibility
- removeSelf
- flipX
- flipY
- place
- callFunc
- sequence
- repeat
- repeatForever
- spawn
- rotateTo
- rotateBy
- moveBy
- moveTo
- skewTo
- skewBy
- jumpBy
- jumpTo
- bezierBy
- bezierTo
- scaleTo
- scaleBy
- blink
- fadeTo
- fadeIn
- fadeOut
- tintTo
- tintBy
- delayTime
- reverseTime
- animate
- targetedAction
- CGAffineToGL
- GLToCGAffine
- isChildClassOf
- associateWithNative
- getImageFormatByData
- inherits
- setAccelerometerEnabled
- setAccelerometerInterval
- swap
- lerp
- rand
- randomMinus1To1
- random0To1
- degreesToRadians
- radiansToDegrees
- radiansToDegress
- nodeDrawSetup
- enableDefaultGLStates
- disableDefaultGLStates
- incrementGLDraws
- contentScaleFactor
- pointPointsToPixels
- pointPixelsToPoints
- sizePointsToPixels
- sizePixelsToPoints
- rectPixelsToPoints
- rectPointsToPixels
- checkGLErrorDebug
- deserialize
- instantiate
- find
- Enum
- getList
- pNeg
- pAdd
- pSub
- pMult
- pMidpoint
- pDot
- pCross
- pPerp
- pRPerp
- pProject
- pRotate
- pUnrotate
- pLengthSQ
- pDistanceSQ
- pLength
- pDistance
- pNormalize
- pForAngle
- pToAngle
- clampf
- clamp01
- pClamp
- pFromSize
- pCompOp
- pLerp
- pFuzzyEqual
- pCompMult
- pAngleSigned
- pAngle
- pRotateByAngle
- pLineIntersect
- pSegmentIntersect
- pIntersectPoint
- pSameAs
- pZeroIn
- pIn
- pMultIn
- pSubIn
- pAddIn
- pNormalizeIn
- V3F_C4B_T2F_QuadZero
- V3F_C4B_T2F_QuadCopy
- V3F_C4B_T2F_QuadsCopy
- v2
- p
- pointEqualToPoint
-
js Modules
-
Editor.Menu Classes
-
Editor.Window Classes
-
cc.Acceleration Classes
methods
-
cc.Action Classes
-
cc.ActionEase Classes
-
cc.ActionInstant Classes
-
cc.ActionInterval Classes
-
cc.ActionManager Classes
-
cc.AffineTransform Classes
methods
- affineTransformMake
- affineTransformClone
- pointApplyAffineTransform
- sizeApplyAffineTransform
- affineTransformMakeIdentity
- affineTransformIdentity
- rectApplyAffineTransform
- affineTransformTranslate
- affineTransformScale
- affineTransformRotate
- affineTransformConcat
- affineTransformConcatIn
- affineTransformEqualToTransform
- affineTransformInvert
-
cc.Animation Classes
properties
methods
-
cc.AnimationClip Classes
properties
methods
-
cc.AnimationNode Classes
-
cc.AnimationState Classes
-
cc.Asset Classes
properties
methods
-
cc.AssetLibrary Classes
properties
methods
-
cc.AudioClip Classes
methods
-
cc.AudioSource Classes
properties
- isPlaying
- clip
- volume
- mute
- loop
- playOnLoad
- node
- uuid
- _enabled
- enabled
- enabledInHierarchy
- _isOnLoadCalled
- __eventTargets
- _name
- _objFlags
- name
- isValid
methods
-
cc.BitmapFont Classes
methods
-
cc.BlendFunc Classes
methods
-
cc.Button Classes
-
cc.Button.ClickEvent Classes
-
cc.CallbacksInvoker Classes
-
cc.Canvas Classes
-
cc.Class Classes
methods
-
cc.CoffeeScript Classes
-
cc.Color Classes
-
cc.Component Classes
-
cc.ContainerStrategy Classes
-
cc.ContentStrategy Classes
-
cc.Details Classes
-
cc.EaseBounce Classes
-
cc.EaseElastic Classes
-
cc.EaseRateAction Classes
-
cc.EqualToFrame Classes
-
cc.EqualToWindow Classes
-
cc.Event Classes
-
cc.Event.EventAcceleration Classes
-
cc.Event.EventCustom Classes
-
cc.Event.EventFocus Classes
-
cc.Event.EventKeyboard Classes
-
cc.Event.EventMouse Classes
properties
- type
- target
- currentTarget;
- eventPhase
- _defaultPrevented
- _propagationStopped
- _propagationImmediateStopped
methods
-
cc.Event.EventTouch Classes
-
cc.EventAnimCurve Classes
properties
-
cc.EventInfo Classes
-
cc.EventListener Classes
-
cc.EventTarget Classes
-
cc.FiniteTimeAction Classes
-
cc.Font Classes
methods
-
cc.FontDefinition Classes
methods
-
cc.HashElement Classes
methods
-
cc.HashTimerEntry Classes
-
cc.HashUpdateEntry Classes
-
cc.Label Classes
-
cc.Layout Classes
-
cc.ListEntry Classes
-
cc.Mask Classes
properties
- node
- uuid
- _enabled
- enabled
- enabledInHierarchy
- _isOnLoadCalled
- __eventTargets
- _name
- _objFlags
- name
- isValid
methods
-
cc.Node Classes
properties
- active
- activeInHierarchy
- _components
- _prefab
- _persistNode
- __eventTargets
- name
- parent
- _id
- uuid
- skewX
- skewY
- zIndex
- rotation
- rotationX
- scaleX
- scaleY
- x
- y
- children
- childrenCount
- anchorX
- anchorY
- width
- height
- ignoreAnchor
- tag
- opacity
- cascadeOpacity
- color
- _sizeProvider
- position
- scale
- _name
- _objFlags
- isValid
events
- position-changed
- rotation-changed
- scale-changed
- size-changed
- anchor-changed
- color-changed
- opacity-changed
methods
- getComponent
- addComponent
- _addComponentAt
- removeComponent
- _getDependComponent
- on
- runAction
- stopAllActions
- stopAction
- stopActionByTag
- getActionByTag
- getNumberOfRunningActions
- init
- attr
- setGlobalZOrder
- getGlobalZOrder
- getScale
- setScale
- getPosition
- setPosition
- getAnchorPoint
- setAnchorPoint
- getAnchorPointInPoints
- getContentSize
- setContentSize
- getBoundingBox
- cleanup
- getChildByTag
- getChildByName
- addChild
- removeFromParent
- removeChild
- removeChildByTag
- removeAllChildren
- getParentToNodeTransform
- getNodeToWorldTransform
- getWorldToNodeTransform
- convertToNodeSpace
- convertToWorldSpace
- convertToNodeSpaceAR
- convertToWorldSpaceAR
- convertTouchToNodeSpace
- convertTouchToNodeSpaceAR
- getNodeToParentTransform
- getBoundingBoxToWorld
- getDisplayedOpacity
- getDisplayedColor
- setOpacityModifyRGB
- isOpacityModifyRGB
- getSiblingIndex
- setSiblingIndex
- isChildOf
- getPositionX
- setPositionX
- getPositionY
- setPositionY
- getLocalZOrder
- setLocalZOrder
- isIgnoreAnchorPointForPosition
- ignoreAnchorPointForPosition
- isCascadeOpacityEnabled
- setCascadeOpacityEnabled
- isCascadeColorEnabled
- setCascadeColorEnabled
- destroy
- realDestroyInEditor
- _destruct
- _onPreDestroy
- _serialize
- _deserialize
-
cc.Node.EventType Classes
-
cc.OriginalContainer Classes
-
cc.Playable Classes
-
cc.Prefab Classes
-
cc.ProgressBar Classes
properties
- barSprite
- mode
- totalLength
- progress
- reverse
- node
- uuid
- _enabled
- enabled
- enabledInHierarchy
- _isOnLoadCalled
- __eventTargets
- _name
- _objFlags
- name
- isValid
methods
-
cc.ProportionalToFrame Classes
-
cc.ProportionalToWindow Classes
-
cc.Quad2 Classes
-
cc.Quad3 Classes
methods
-
cc.RawAsset Classes
methods
-
cc.Rect Classes
properties
methods
-
cc.ResolutionPolicy Classes
properties
methods
-
cc.SampledAnimCurve Classes
-
cc.Scene Classes
-
cc.Scheduler Classes
properties
methods
- setTimeScale
- getTimeScale
- update
- scheduleCallbackForTarget
- schedule
- pauseAllTargets
- pauseAllTargetsWithMinPriority
- resumeTargets
- pauseTarget
- resumeTarget
- isTargetPaused
- scheduleUpdateForTarget
- unscheduleCallbackForTarget
- unscheduleUpdateForTarget
- unscheduleAllCallbacksForTarget
- unscheduleAllCallbacks
- unscheduleAllCallbacksWithMinPriority
-
cc.ScrollView Classes
properties
- content
- horizontal
- vertical
- inertia
- brake
- elastic
- bounceDuration
- horizontalScrollBar
- verticalScrollBar
- node
- uuid
- _enabled
- enabled
- enabledInHierarchy
- _isOnLoadCalled
- __eventTargets
- _name
- _objFlags
- name
- isValid
methods
- scrollToBottom
- scrollToTop
- scrollToLeft
- scrollToRight
- scrollToTopLeft
- scrollToTopRight
- scrollToBottomLeft
- scrollToBottomRight
- scrollToPercentHorizontal
- scrollTo
- scrollToPercentVertical
- setContentPosition
- getContentPosition
- update
- lateUpdate
- onLoad
- start
- onEnable
- onDisable
- onDestroy
- onFocusInEditMode
- onLostFocusInEditMode
- addComponent
- getComponent
- schedule
- scheduleOnce
- unschedule
- unscheduleAllCallbacks
- destroy
- realDestroyInEditor
- _destruct
- _onPreDestroy
- _serialize
- _deserialize
-
cc.Scrollbar Classes
-
cc.Size Classes
-
cc.Sprite Classes
properties
- _atlas
- sprite
- type
- node
- uuid
- _enabled
- enabled
- enabledInHierarchy
- _isOnLoadCalled
- __eventTargets
- _name
- _objFlags
- name
- isValid
methods
- setVisible
- setScale9Enabled
- isScale9Enabled
- initWithFile
- initWithSpriteFrame
- initWithSpriteFrameName
- getOriginalSize
- setInsetLeft
- getInsetLeft
- setInsetTop
- getInsetTop
- setInsetRight
- getInsetRight
- setInsetBottom
- getInsetBottom
- _createSgNode
- update
- lateUpdate
- onLoad
- start
- onEnable
- onDisable
- onDestroy
- onFocusInEditMode
- onLostFocusInEditMode
- addComponent
- getComponent
- schedule
- scheduleOnce
- unschedule
- unscheduleAllCallbacks
- destroy
- realDestroyInEditor
- _destruct
- _onPreDestroy
- _serialize
- _deserialize
-
cc.SpriteAnimationAsset Classes
properties
methods
-
cc.SpriteAtlas Classes
methods
-
cc.SpriteFrame Classes
properties
methods
- textureLoaded
- addLoadedEventListener
- getRectInPixels
- setRectInPixels
- isRotated
- setRotated
- getRect
- setRect
- getOffsetInPixels
- setOffsetInPixels
- getOriginalSizeInPixels
- setOriginalSizeInPixels
- getOriginalSize
- setOriginalSize
- getTexture
- _refreshTexture
- getOffset
- setOffset
- clone
- initWithTexture
- copyWithZone
- copy
- cc.SpriteFrame.create
- cc.SpriteFrame.createWithTexture
- serialize
- createNode
- _setRawFiles
- createNodeByInfo
-
cc.TTFFont Classes
-
cc.Tex2F Classes
-
cc.TextAsset Classes
-
cc.Texture2D Classes
properties
methods
-
cc.Texture2D.WrapMode Classes
properties
-
cc.TextureAtlas Classes
properties
methods
- getTotalQuads
- getCapacity
- getTexture
- setTexture
- setDirty
- isDirty
- getQuads
- setQuads
- initWithFile
- initWithTexture
- updateQuad
- insertQuad
- insertQuads
- insertQuadFromIndex
- removeQuadAtIndex
- removeQuadsAtIndex
- removeAllQuads
- resizeCapacity
- increaseTotalQuadsWith
- moveQuadsFromIndex
- fillWithEmptyQuadsFromIndex
- drawNumberOfQuads
-
cc.TiledMapAsset Classes
methods
-
cc.Timer Classes
methods
-
cc.Touch Classes
-
cc.V2F_C4B_T2F Classes
-
cc.V2F_C4B_T2F_Triangle Classes
methods
-
cc.V3F_C4B_T2F Classes
methods
-
cc.V3F_C4B_T2F_Quad Classes
-
cc.ValueType Classes
-
cc.Vec2 Classes
-
cc.Vertex2F Classes
-
cc.Vertex3F Classes
-
cc.WebGLColor Classes
-
cc.Widget Classes
properties
- isAlignTop
- isAlignVerticalCenter
- isAlignBottom
- isAlignLeft
- isAlignHorizontalCenter
- isAlignRight
- isStretchHeight
- isStretchHeight
- top
- bottom
- left
- right
- isAbsoluteTop
- isAbsoluteBottom
- isAbsoluteLeft
- isAbsoluteRight
- _alignFlags
- node
- uuid
- _enabled
- enabled
- enabledInHierarchy
- _isOnLoadCalled
- __eventTargets
- _name
- _objFlags
- name
- isValid
methods
-
cc.audioEngine Classes
-
cc.director Classes
methods
- convertToGL
- convertToUI
- getContentScaleFactor
- getNotificationNode
- getWinSize
- getWinSizeInPixels
- getVisibleSize
- getVisibleOrigin
- getZEye
- pause
- pushScene
- runScene
- loadScene
- _loadSceneByUuid
- resume
- setDepthTest
- setClearColor
- setOpenGLView
- setProjection
- setViewport
- getOpenGLView
- getProjection
- setAlphaBlending
- isSendCleanupToScene
- getRunningScene
- getScene
- getAnimationInterval
- isDisplayStats
- setDisplayStats
- getSecondsPerFrame
- isNextDeltaTimeZero
- isPaused
- getTotalFrames
- getScheduler
- setScheduler
- getActionManager
- setActionManager
- getAnimationManager
- getDeltaTime
-
cc.eventManager Classes
-
cc.game Classes
-
cc.inputManager Classes
-
cc.loader Classes
-
cc.pool Classes
-
cc.screen Classes
-
cc.spriteFrameCache Classes
-
cc.sys Classes
properties
- LANGUAGE_ENGLISH
- LANGUAGE_CHINESE
- LANGUAGE_FRENCH
- LANGUAGE_ITALIAN
- LANGUAGE_GERMAN
- LANGUAGE_SPANISH
- LANGUAGE_DUTCH
- LANGUAGE_RUSSIAN
- LANGUAGE_KOREAN
- LANGUAGE_JAPANESE
- LANGUAGE_HUNGARIAN
- LANGUAGE_PORTUGUESE
- LANGUAGE_ARABIC
- LANGUAGE_NORWEGIAN
- LANGUAGE_POLISH
- LANGUAGE_UNKNOWN
- OS_IOS
- OS_ANDROID
- OS_WINDOWS
- OS_MARMALADE
- OS_LINUX
- OS_BADA
- OS_BLACKBERRY
- OS_OSX
- OS_WP8
- OS_WINRT
- OS_UNKNOWN
- UNKNOWN
- WIN32
- LINUX
- MACOS
- ANDROID
- IOS
- IPAD
- BLACKBERRY
- NACL
- EMSCRIPTEN
- TIZEN
- WINRT
- WP8
- MOBILE_BROWSER
- DESKTOP_BROWSER
- EDITOR_PAGE
- EDITOR_CORE
- BROWSER_TYPE_WECHAT
- BROWSER_TYPE_ANDROID
- BROWSER_TYPE_IE
- BROWSER_TYPE_QQ
- BROWSER_TYPE_MOBILE_QQ
- BROWSER_TYPE_UC
- BROWSER_TYPE_360
- BROWSER_TYPE_BAIDU_APP
- BROWSER_TYPE_BAIDU
- BROWSER_TYPE_MAXTHON
- BROWSER_TYPE_OPERA
- BROWSER_TYPE_OUPENG
- BROWSER_TYPE_MIUI
- BROWSER_TYPE_FIREFOX
- BROWSER_TYPE_SAFARI
- BROWSER_TYPE_CHROME
- BROWSER_TYPE_LIEBAO
- BROWSER_TYPE_QZONE
- BROWSER_TYPE_SOUGOU
- BROWSER_TYPE_UNKNOWN
- isNative
- isBrowser
- isMobile
- platform
- language
- os
- browserType
- browserVersion
- windowPixelResolution
- localStorage
- capabilities
methods
-
cc.textureCache Classes
-
cc.url Classes
-
cc.view Classes
methods
- setTargetDensityDPI
- getTargetDensityDPI
- resizeWithBrowserSize
- setResizeCallback
- adjustViewPort
- enableRetina
- isRetinaEnabled
- enableAutoFullScreen
- isAutoFullScreenEnabled
- isOpenGLReady
- setIMEKeyboardState
- setContentTranslateLeftTop
- getContentTranslateLeftTop
- setCanvasSize
- getCanvasSize
- getFrameSize
- setFrameSize
- getVisibleSize
- getVisibleSizeInPixel
- getVisibleOrigin
- getVisibleOriginInPixel
- canSetContentScaleFactor
- getResolutionPolicy
- setResolutionPolicy
- setDesignResolutionSize
- getDesignResolutionSize
- setRealPixelResolution
- setViewPortInPoints
- setScissorInPoints
- isScissorEnabled
- getScissorRect
- setViewName
- getViewName
- getViewPortRect
- getScaleX
- getScaleY
- getDevicePixelRatio
- convertToLocationInView
- _getInstance
-
cc.visibleRect Classes
-
js.array Classes
-
cc.Button.Transition Enums
-
cc.DebugMode Enums
-
cc.KEY Enums
- none
- back
- menu
- backspace
- tab
- enter
- shift
- ctrl
- alt
- pause
- capslock
- escape
- space
- pageup
- pagedown
- end
- home
- left
- up
- right
- down
- select
- insert
- Delete
- 0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- a
- b
- c
- d
- e
- f
- g
- h
- i
- j
- k
- l
- m
- n
- o
- p
- q
- r
- s
- t
- u
- v
- w
- x
- y
- z
- num0
- num1
- num2
- num3
- num5
- num6
- num7
- num8
- num9
- *
- +
- -
- numdel
- /
- f1
- f2
- f3
- f4
- f5
- f6
- f7
- f8
- f9
- f10
- f11
- f12
- numlock
- scrolllock
- ;
- semicolon
- equal
- =
- ,
- comma
- dash
- .
- period
- forwardslash
- grave
- [
- openbracket
- backslash
- ]
- closebracket
- quote
- dpadLeft
- dpadRight
- dpadUp
- dpadDown
- dpadCenter
-
cc.Layout.Type Enums
-
cc.ProgressBar.Mode Enums
-
cc.Scrollbar.Direction Enums
-
cc.SpriteType Enums
-
cc.TextAlignment Enums
-
cc.UIOrientation Enums
-
cc.VerticalTextAlignment Enums
-
cc.WrapMode Enums
properties
properties
properties
properties
properties
properties
properties
view
cc.view is the singleton object which represents the game window.
It's main task include:
- Apply the design resolution policy
- Provide interaction with the window, like resize event on web, retina display support, etc...
- Manage the game view port which can be different with the window
- Manage the content scale and translation
Since the cc.view is a singleton, you don't need to call any constructor or create functions,
the standard way to use it is by calling: - cc.view.methodName();
Methods
setTargetDensityDPI
(
-
densityDPI
)
- densityDPI
Sets view's target-densitydpi for android mobile browser. it can be set to:
- cc.DENSITYDPI_DEVICE, value is "device-dpi"
- cc.DENSITYDPI_HIGH, value is "high-dpi" (default value)
- cc.DENSITYDPI_MEDIUM, value is "medium-dpi" (browser's default value)
- cc.DENSITYDPI_LOW, value is "low-dpi"
- Custom value, e.g: "480"
name | type | description |
---|---|---|
densityDPI
|
String |
getTargetDensityDPI ( ) String
Returns the current target-densitydpi value of cc.view.
returns:
resizeWithBrowserSize
(
-
enabled
)
- enabled
Sets whether resize canvas automatically when browser's size changed.
Useful only on web.
name | type | description |
---|---|---|
enabled
|
Boolean |
Whether enable automatic resize with browser's resize event |
setResizeCallback
(
-
callback
)
- callback
Sets the callback function for cc.view's resize action,
this callback will be invoked before applying resolution policy,
so you can do any additional modifications within the callback.
Useful only on web.
name | type | description |
---|---|---|
callback
|
Function | Null |
The callback function |
adjustViewPort
(
-
enabled
)
- enabled
Sets whether the engine modify the "viewport" meta in your web page.
It's enabled by default, we strongly suggest you not to disable it.
And even when it's enabled, you can still set your own "viewport" meta, it won't be overridden
Only useful on web
name | type | description |
---|---|---|
enabled
|
Boolean |
Enable automatic modification to "viewport" meta |
enableRetina
(
-
enabled
)
- enabled
Retina support is enabled by default for Apple device but disabled for other devices,
it takes effect only when you called setDesignResolutionPolicy
Only useful on web
name | type | description |
---|---|---|
enabled
|
Boolean |
Enable or disable retina display |
isRetinaEnabled ( ) Boolean
Check whether retina display is enabled.
Only useful on web
returns:
enableAutoFullScreen
(
-
enabled
)
- enabled
If enabled, the application will try automatically to enter full screen mode on mobile devices
You can pass true as parameter to enable it and disable it by passing false.
Only useful on web
name | type | description |
---|---|---|
enabled
|
Boolean |
Enable or disable auto full screen on mobile devices |
isAutoFullScreenEnabled ( ) Boolean
Check whether auto full screen is enabled.
Only useful on web
returns:
isOpenGLReady ( ) Boolean
Get whether render system is ready(no matter opengl or canvas),
this name is for the compatibility with cocos2d-x, subclass must implement this method.
returns:
setIMEKeyboardState
(
-
isOpen
)
- isOpen
Open or close IME keyboard , subclass must implement this method.
name | type | description |
---|---|---|
isOpen
|
Boolean |
setContentTranslateLeftTop
(
-
offsetLeft
-
offsetTop
)
- offsetLeft
- offsetTop
setCanvasSize
(
-
width
-
height
)
- width
- height
getCanvasSize ( ) Size
Returns the canvas size of the view.
On native platforms, it returns the screen size since the view is a fullscreen view.
On web, it returns the size of the canvas element.
returns:
getFrameSize ( ) Size
Returns the frame size of the view.
On native platforms, it returns the screen size since the view is a fullscreen view.
On web, it returns the size of the canvas's outer DOM element.
returns:
setFrameSize
(
-
width
-
height
)
- width
- height
canSetContentScaleFactor ( ) Boolean
Returns whether developer can set content's scale factor.
returns:
getResolutionPolicy ( ) ResolutionPolicy
Returns the current resolution policy
returns:
setResolutionPolicy
(
-
resolutionPolicy
)
- resolutionPolicy
Sets the current resolution policy
name | type | description |
---|---|---|
resolutionPolicy
|
ResolutionPolicy | Number |
setDesignResolutionSize
(
-
width
-
height
-
resolutionPolicy
)
- width
- height
- resolutionPolicy
Sets the resolution policy with designed view size in points.
The resolution policy include:
[1] ResolutionExactFit Fill screen by stretch-to-fit: if the design resolution ratio of width to height is different from the screen resolution ratio, your game view will be stretched.
[2] ResolutionNoBorder Full screen without black border: if the design resolution ratio of width to height is different from the screen resolution ratio, two areas of your game view will be cut.
[3] ResolutionShowAll Full screen with black border: if the design resolution ratio of width to height is different from the screen resolution ratio, two black borders will be shown.
[4] ResolutionFixedHeight Scale the content's height to screen's height and proportionally scale its width
[5] ResolutionFixedWidth Scale the content's width to screen's width and proportionally scale its height
[cc.ResolutionPolicy] [Web only feature] Custom resolution policy, constructed by cc.ResolutionPolicy
name | type | description |
---|---|---|
width
|
Number |
Design resolution width. |
height
|
Number |
Design resolution height. |
resolutionPolicy
|
ResolutionPolicy | Number |
The resolution policy desired |
getDesignResolutionSize ( ) Size
Returns the designed size for the view. Default resolution size is the same as 'getFrameSize'.
returns:
setRealPixelResolution
(
-
width
-
height
-
resolutionPolicy
)
- width
- height
- resolutionPolicy
Sets the container to desired pixel resolution and fit the game content to it. This function is very useful for adaptation in mobile browsers. In some HD android devices, the resolution is very high, but its browser performance may not be very good. In this case, enabling retina display is very costy and not suggested, and if retina is disabled, the image may be blurry. But this API can be helpful to set a desired pixel resolution which is in between. This API will do the following: 1. Set viewport's width to the desired width in pixel 2. Set body width to the exact pixel resolution 3. The resolution policy will be reset with designed view size in points.
name | type | description |
---|---|---|
width
|
Number |
Design resolution width. |
height
|
Number |
Design resolution height. |
resolutionPolicy
|
ResolutionPolicy | Number |
The resolution policy desired |
setViewPortInPoints
(
-
x
-
y
-
w
-
h
)
- x
- y
- w
- h
setScissorInPoints
(
-
x
-
y
-
w
-
h
)
- x
- y
- w
- h
getScaleX ( ) Number
Returns scale factor of the horizontal direction (X axis).
returns:
convertToLocationInView
(
-
tx
-
ty
-
relatedPos
)
Vec2
- tx
- ty
- relatedPos
_getInstance ( ) EGLView private
returns:
There are no methods that match your current filter settings. You can change your filter settings in the index section on this page. index