博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
cocos2dx中设置横竖版
阅读量:4488 次
发布时间:2019-06-08

本文共 424 字,大约阅读时间需要 1 分钟。

IOS目录中RootViewController.mm
//显示竖屏
- (BOOL) shouldAutorotate {
return NO;
}

//显示横屏

- (BOOL) shouldAutorotate {
return YES;
}

还有一个屏目适配:

AppDelegate 中:

CCDirector* pDirector = CCDirector::sharedDirector();

    CCEGLView* pEGLView = CCEGLView::sharedOpenGLView();

 

    pDirector->setOpenGLView(pEGLView);

 

    pEGLView->setDesignResolutionSize(320 ,480, kResolutionNoBorder);//这个是跟据图片的大小来设置

转载于:https://www.cnblogs.com/jackluo/p/3751304.html

你可能感兴趣的文章
AspNet Core 发布到Linux系统和发布IIS 注意项
查看>>
Windows添加.NET Framework 3.0 NetFx3 失败 - 状态为:0x800f0950
查看>>
隐藏显示终端的光标(shell echo,linux c printf)
查看>>
SQL Server 存储过程
查看>>
JSP 标准标签库(JSTL)(JSP Standard Tag Library)
查看>>
导入项目遇到的问题: Some projects cannot be imported because they already exist in the workspace....
查看>>
华为:字符集合
查看>>
用Okhttp框架登录之后的Cookie设置到webView中(转)
查看>>
Java_Activiti5_菜鸟也来学Activiti5工作流_之入门简单例子(一)
查看>>
设计模式(一)工厂模式Factory(创建型)
查看>>
linux中安装软件的集中方法
查看>>
Express中间件,看这篇文章就够了(#^.^#)
查看>>
《构建之法》(五)
查看>>
创建django项目
查看>>
Linux Bash基本功能
查看>>
一则小脚本(工作中用)
查看>>
软件工程结对作业
查看>>
Keil 4.0 生成bin文件
查看>>
sql语句的进化--hibernate篇
查看>>
python爬虫之cookie
查看>>