博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Cocos2d-x开发-横屏
阅读量:2341 次
发布时间:2019-05-10

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

Cocos2d-x开发-横屏

1、新建一个cocos2d-x项目<IOS>;

2、AppDelegate.cpp  中大约 84行,注释pDirector->setDeviceOrientation(kCCDeviceOrientationLandscapeRight); 

3、重载RootViewController.mm 中的 - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {return UIInterfaceOrientationIsLandscape( interfaceOrientation );}

4、不需要在Info.plist中添加 Supported interface orientations。

一、横屏、竖屏设置

        AndroidManifest.xml文件中,
        screenOrientation="landscape" 为横屏, screenOrientation="portrait"为竖屏
二、读写sd卡
        AndroidManifest.xml文件中,先增加权限:
        <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
        <uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS"/>
        FILE *fp = fopen("/mnt/sdcard/xxx.xxx", "rb+");
        此时就可以了,切记根目录前缀:/mnt/sdcard/ 指代sd卡的根目录

转载地址:http://mtuvb.baihongyu.com/

你可能感兴趣的文章
centos7单用户模式修改root密码
查看>>
linux文件类型
查看>>
alias,which命令
查看>>
数组名和指针的区别
查看>>
栈和堆的具体区别
查看>>
如何判断一个点在矩形内
查看>>
析构函数何时被调用
查看>>
C++虚函数底层机制
查看>>
面试题:随机数生成、蓄水池抽样、海量数据、设计秒杀系统
查看>>
linux清除cache的方法
查看>>
memmove 和 memcpy的区别以及处理内存重叠问题
查看>>
费雪耶兹(Fisher–Yates) 也被称作高纳德( Knuth)随机置乱算法
查看>>
C/C++中变量的存储位置
查看>>
C++中四种强制类型转换区别详解
查看>>
linux gdb的详细用法 运行与断点
查看>>
删除vector中重复元素
查看>>
和为s的连续正数序列
查看>>
什么是Redis?什么是nosql?NoSQL数据库的四大分类
查看>>
为什么说Redis是单线程的以及Redis为什么这么快!
查看>>
redis的过期健删除策略以及内存淘汰机制
查看>>