Class cc.EGLView
- Defined in: CCEGLView.js
- Extends cc.Class
Constructor Attributes | Constructor Name and Description |
---|---|
Method Summary
Class Detail
cc.EGLView()
Method Detail
-
convertToLocationInView(tx, ty, relatedPos)Get the real location in view
- Parameters:
- tx
- ty
- relatedPos
-
end()Force destroying EGL view, subclass must implement this method.
-
{cc.Size|Object} getContentTranslateLeftTop()
get the resolution translate on EGLView
- Returns:
- {cc.Size|Object}
-
{cc.Size} getDesignResolutionSize()Get design resolution size. Default resolution size is the same as 'getFrameSize'.
- Returns:
- {cc.Size}
-
{cc.Size} getFrameSize()Get the frame size of EGL view. In general, it returns the screen size since the EGL view is a fullscreen view.
- Returns:
- {cc.Size}
-
{cc.ResolutionPolicy} getResolutionPolicy()Get the current resolution policy
- Returns:
- {cc.ResolutionPolicy}
-
getScaleX()Get scale factor of the horizontal direction.
-
getScaleY()Get scale factor of the vertical direction.
-
{cc.Rect} getScissorRect()Get the current scissor rectangle
- Returns:
- {cc.Rect}
-
getSetOfTouchesEndOrCancel(arr, num, ids, xs, ys)
- Parameters:
- {Array} arr
- {Number} num
- {Number} ids
- {Number} xs
- {Number} ys
-
{String} getViewName()get view name
- Returns:
- {String}
-
getViewPortRect()Get the opengl view port rectangle.
-
{cc.Point} getVisibleOrigin()Get the visible origin povar of opengl viewport.
- Returns:
- {cc.Point}
-
{cc.Size} getVisibleSize()Get the visible area size of opengl viewport.
- Returns:
- {cc.Size}
-
handleTouchesBegin(num, ids, xs, ys)Touch events are handled by default; if you want to customize your handlers, please override these functions:
- Parameters:
- {Number} num
- {Array} ids
- {Array} xs
- {Array} ys
-
handleTouchesCancel(num, ids, xs, ys)
- Parameters:
- {Number} num
- {Number} ids
- {Number} xs
- {Number} ys
-
handleTouchesEnd(num, ids, xs, ys)
- Parameters:
- {Number} num
- {Number} ids
- {Number} xs
- {Number} ys
-
handleTouchesMove(num, ids, xs, ys)
- Parameters:
- {Number} num
- {Number} ids
- {Number} xs
- {Number} ys
-
initialize()init
-
{Boolean} isOpenGLReady()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:
- {Boolean}
-
isScissorEnabled()Get whether GL_SCISSOR_TEST is enable
-
setContentTranslateLeftTop(offsetLeft, offsetTop)
The resolution translate on EGLView
- Parameters:
- {Number} offsetLeft
- {Number} offsetTop
-
setDesignResolutionSize(width, height, resolutionPolicy)Set the design resolution size.
- Parameters:
- {Number} width
- Design resolution width.
- {Number} height
- Design resolution height.
- {cc.ResolutionPolicy|Number} resolutionPolicy
- The resolution policy desired, you may choose: [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] Custom resolution policy, constructed by cc.ResolutionPolicy
-
setFrameSize(width, height)Set the frame size of EGL view.
- Parameters:
- {Number} width
- {Number} height
-
setIMEKeyboardState(isOpen)Open or close IME keyboard , subclass must implement this method.
- Parameters:
- isOpen
-
setResolutionPolicy(resolutionPolicy)Set the current resolution policy
- Parameters:
- {cc.ResolutionPolicy|Number} resolutionPolicy
-
setScissorInPoints(x, y, w, h)Set Scissor rectangle with points.
- Parameters:
- {Number} x
- {Number} y
- {Number} w
- {Number} h
-
setTouchDelegate(delegate)set touch delegate
- Parameters:
- {cc.TouchDispatcher} delegate
-
setViewName(viewName)
- Parameters:
- {String} viewName
-
setViewPortInPoints(x, y, w, h)Set opengl view port rectangle with points.
- Parameters:
- {Number} x
- {Number} y
- {Number} w
- width
- {Number} h
- height
-
swapBuffers()Exchanges the front and back buffers, subclass must implement this method.