cocos2d-x 3.0
- 首页 - 相关页面 - 模块 - 命名空间 - - 文件 -
Public 成员函数 - 图1 Public 成员函数 - 图2)
- 类列表 - 类索引 - 类继承关系 - 类成员

全部)) 命名空间) 文件) 函数) 变量) 类型定义) 枚举) 枚举值) 属性) 友元) 宏定义)))

Public 成员函数 | Protected 属性 | 所有成员列表

DisplayLinkDirector类 参考 Base Nodes

DisplayLinkDirector是一个Director的子类, 表示屏幕刷新速率的同步定时器 更多…

#include

类 DisplayLinkDirector 继承关系图:

Public 成员函数 - 图3 Director Ref

## Public 成员函数
DisplayLinkDirector ()
virtual ~DisplayLinkDirector ()
virtual void mainLoop () override
virtual void setAnimationInterval (double value) override
Set FPS 值. 更多…
virtual void startAnimation () override
主循环线程重新被触发发. 更多…
virtual void stopAnimation () override
停止动画,什么也不画. 更多…
- Public 成员函数 继承自 Director
void pushMatrix (MATRIX_STACK_TYPE type)
void popMatrix (MATRIX_STACK_TYPE type)
void loadIdentityMatrix (MATRIX_STACK_TYPE type)
void loadMatrix (MATRIX_STACK_TYPE type, const Mat4 &mat)
void multiplyMatrix (MATRIX_STACK_TYPE type, const Mat4 &mat)
Mat4 getMatrix (MATRIX_STACK_TYPE type)
void resetMatrixStack ()
Director (void)
ctor 更多…
virtual ~Director ()
NA NA 更多…
virtual bool init ()
Scene getRunningScene ()
获取当前运行的场景(Scene). 更多…
double getAnimationInterval ()
Get FPS 值 更多…
bool isDisplayStats ()
是否在左下角显示 FPS 更多…
void setDisplayStats (bool displayStats)
在左下角显示 FPS 更多…
float getSecondsPerFrame ()
每帧秒 更多…
GLView getOpenGLView ()
获取渲染所有东西的 EGLView NA NA 更多…
void setOpenGLView (GLView openGLView)
TextureCache getTextureCache () const
bool isNextDeltaTimeZero ()
void setNextDeltaTimeZero (bool nextDeltaTimeZero)
bool isPaused ()
Director 是否被暂停 更多…
unsigned int getTotalFrames ()
director 开始到现在持续了多少帧 更多…
Projection getProjection ()
设置一个 OpenGL 投影 更多…
void setProjection (Projection projection)
void setViewport ()
设置 glViewport 更多…
bool isSendCleanupToScene ()
director 开始到现在持续了多少帧 更多…
Node getNotificationNode () const
主场景访问后这个对象将被访问 这个对象必须实现"访问"("visit") 选择器. 更多…
void setNotificationNode (Node node)
const Size & getWinSize () const
返回以点为单位的 OpenGL 视图的大小. 更多…
Size getWinSizeInPixels () const
返回以像素为单位的 OpenGL 视图的大小. 更多…
Size getVisibleSize () const
returns 以点为单位的 OpenGL 视图的可见大小. 更多…
Vec2 getVisibleOrigin () const
returns 以点为单位的 OpenGL 视图的初始化时的可见大小 更多…
Vec2 convertToGL (const Vec2 &point)
UIKit的坐标转换到一个OpenGL坐标 使用当前布局(横向或纵向)有效的(多)触摸坐标 更多…
Vec2 convertToUI (const Vec2 &point)
一个OpenGL坐标转换到UIKit的坐标 点组成的窗口调用有效的节点上面的点,例如 glScissor 更多…
float getZEye () const
XXX: 缺少描述 更多…
void runWithScene (Scene scene)
根据给定的场景进入 Director的主循环 只能调用他运行你的第一个场景. 更多…
void pushScene (Scene scene)
暂停执行正在运行的场景中,pushing一个在堆栈上推暂停的场景。 新的场景将被执行. 更多…
void popScene ()
从队列中弹出一个场景。 这个场景将替换正在运行的场景. 更多…
void popToRootScene ()
从队列中弹出所有的场景,直到只有根场景在队列中 这个场景将替换正在运行的场景. 更多…
void popToSceneStackLevel (int level)
弹出从队列中的所有场景,直到它到达 level. 更多…
void replaceScene (Scene scene)
用一个新的替换正在运行的场景。终止正在运行的场景。 仅在有一个正在运行的场景的时候调用他. 更多…
void end ()
结束执行,释放正在运行的场景。 它不会从其父视图中删除的OpenGL视图。你有做手工。 endToLua 更多…
void pause ()
暂停正在运行的场景。. 更多…
void resume ()
恢复暂停的场景 预定的定时器将被再次激活。 “推迟执行”的时间将是0(如果游戏没有暂停) 更多…
void drawScene ()
绘制场景. 更多…
void purgeCachedData ()
移除所有 cocos2d 缓存数据. 更多…
void setDefaultValues ()
设置配置信息的默认值 更多…
void setGLDefaultValues ()
设置 OpenGL 默认值 更多…
void setAlphaBlending (bool on)
启用/禁用 OpenGL alpha 混合 更多…
void setDepthTest (bool on)
启用/禁用 OpenGL 深度测试 更多…
void setContentScaleFactor (float scaleFactor)
基于像素的 surface 尺寸. 更多…
float getContentScaleFactor () const
Scheduler getScheduler () const
获取和这个 director 关联的调度器 更多…
void setScheduler (Scheduler scheduler)
设置和这个 director 关联的调度器 更多…
ActionManager getActionManager () const
获取和这个 director 关联的 ActionManager 更多…
void setActionManager (ActionManager actionManager)
设置和这个 director 关联的 ActionManager 更多…
EventDispatcher getEventDispatcher () const
获取和这个director 关联的EventDispatcher 更多…
void setEventDispatcher (EventDispatcher dispatcher)
设置和这个director 关联的EventDispatcher 更多…
Renderer getRenderer () const
返回渲染器(Renderer) 更多…
float getDeltaTime () const
返回控制台(Console) 更多…
float getFrameRate () const
获取帧频率(Frame Rate) 更多…
- Public 成员函数 继承自 Ref
void retain ()
保留所有权. 更多…
void release ()
立即释放所有权. 更多…
Ref * autorelease ()
自动释放所有权在不久的将来. 更多…
unsigned int getReferenceCount () const
返回Ref对象当前的引用计数. 更多…
virtual ~Ref ()
NA NA 更多…
## Protected 属性
bool _invalid
- Protected 属性 继承自 Director
bool _purgeDirectorInNextLoop
Scheduler _scheduler
和 director 关联的调度器(Scheduler) 更多…
ActionManager _actionManager
和 director 关联的ActionManager 更多…
EventDispatcher _eventDispatcher
和 director 关联的事件派发器(EventDispatcher) 更多…
EventCustom _eventProjectionChanged
EventCustom _eventAfterDraw
EventCustom _eventAfterVisit
EventCustom _eventAfterUpdate
float _deltaTime
GLView _openGLView
TextureCache _textureCache
double _animationInterval
double _oldAnimationInterval
bool _landscape
bool _displayStats
float _accumDt
float _frameRate
LabelAtlas _FPSLabel
LabelAtlas _drawnBatchesLabel
LabelAtlas _drawnVerticesLabel
bool _paused
Director 是否暂停了 更多…
unsigned int _totalFrames
unsigned int _frames
float _secondsPerFrame
Scene _runningScene
Scene _nextScene
bool _sendCleanupToScene
Vector< Scene > _scenesStack
struct timeval _lastUpdate
bool _nextDeltaTimeZero
Projection _projection
Size _winSizeInPoints
float _contentScaleFactor
Node _notificationNode
Renderer _renderer
- Protected 属性 继承自 Ref
unsigned int _referenceCount
引用计数 更多…
## 额外继承的成员函数
- Public 类型 继承自 Director
enum Projection { _2D, _3D, CUSTOM, DEFAULT = _3D }
- 静态 Public 成员函数 继承自 Director
static Director getInstance ()
返回导演(Director)的共享实例 更多…
static CC_DEPRECATED_ATTRIBUTE Director sharedDirector ()
- 静态 Public 属性 继承自 Director
static const char EVENT_PROJECTION_CHANGED
static const char EVENT_AFTER_UPDATE
static const char EVENT_AFTER_VISIT
static const char EVENT_AFTER_DRAW
- Protected 成员函数 继承自 Director
void initMatrixStack ()
void purgeDirector ()
void setNextScene ()
void showStats ()
void createStatsLabel ()
void calculateMPF ()
void getFPSImageData (unsigned char *datapointer, ssize_t length)
void calculateDeltaTime ()
计算上次和这次主循环线程之间的延迟时间 更多…
void initTextureCache ()
void destroyTextureCache ()
- Protected 成员函数 继承自 Ref
Ref ()
构造函数 更多…

详细描述

DisplayLinkDirector是一个Director的子类, 表示屏幕刷新速率的同步定时器

特点和局限性:

  • 调度定时器(Scheduled timers) & 绘制和屏幕刷新速率保持同步
  • 只支持动画间隔时 1/60 1/30 & 1/15 的情况
  • 自从
  • v0.8.2

构造及析构函数说明

DisplayLinkDirector ( )

inline

virtual ~DisplayLinkDirector ( )

inlinevirtual

成员函数说明

virtual void mainLoop ( )

overridevirtual

实现了 Director.

virtual void setAnimationInterval ( double interval)

overridevirtual

Set FPS 值.

实现了 Director.

virtual void startAnimation ( )

overridevirtual

主循环线程重新被触发发.

这个函数只在你已经调用 [stopAnimation] 函数的时候调用

  • 警告
  • 不要使用这个函数启动主线程循环. 请使用 主线程调用 runWithScene

实现了 Director.

virtual void stopAnimation ( )

overridevirtual

停止动画,什么也不画.

主循环线程再也不会被触发. 如果你不希望那样,那么就用暂停你的游戏代替

实现了 Director.

类成员变量说明

bool _invalid

protected


该类的文档由以下文件生成:

  • /Users/zeroyang/Documents/github/cocos2d-x/cocos/base/CCDirector.h