1 Star 3 Fork 1

agiknight / CocosCreator-Multi-resolution-Adapter

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

Cocos Creator 多分辨率完美适配演示项目

效果预览

使用说明

场景如下:

  1. Canvas 开启 SHOW ALL 模式,并设置你的设计分辨率,如:这里例子为 720 x 1280

  2. Background 背景节点实现 SHOW ALL 模式下 缩放适配 ,操作如下:

    1. Background 背景节点保持和设计分辨率一致的宽高(不能用 Widget 组件)
    2. Background 背景节点挂入 BackgroundAdapter.ts 组件

    操作后结果如下:

  3. Content 内容节点实现 SHOW ALL 模式下 尺寸适配(实质为宽高重置),操作如下:

    1. Content 内容节点保持和设计分辨率一致的宽高(不能用 Widget 组件)
    2. Content 节点挂入 ContentAdapter.ts 组件
    3. 需要实现尺寸适配的节点,直接挂在本节点下就可以,同时子节点可以正常开发使用,比如:直接用 Widget 组件实现撑满父节点范围也是支持的

    操作后结果如下:

更多

本系列教程指引:

  1. Cocos Creator 多分辨率完美适配系列-1(现状与最终效果)
  2. Cocos Creator 多分辨率完美适配系列-2(部署验证设置)
  3. Cocos Creator 多分辨率完美适配系列-3(背景适配实现)
  4. Cocos Creator 多分辨率完美适配系列-4(内容适配实现)
  5. Cocos Creator 多分辨率完美适配系列-5(贴边栏动画实现)
  6. Cocos Creator 多分辨率完美适配系列-6(刘海屏适配)
  7. Cocos Creator 多分辨率完美适配系列-7(封装库使用)

微信小游戏全面屏适配

  1. 全屏适配参考上面章节
  2. 下面为全屏屏顶部适配效果图,具体实现参考 WXGameTopBarUIAdapter.ts

支持一下作者吧

LICENSE

MIT License

Copyright (c) 2019 Zhitao Cai

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
MIT License Copyright (c) 2019 Zhitao Cai Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

Cocos Creator 多分辨率适配方案 展开 收起
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/sylar_game_dev/CocosCreator-Multi-resolution-Adapter.git
git@gitee.com:sylar_game_dev/CocosCreator-Multi-resolution-Adapter.git
sylar_game_dev
CocosCreator-Multi-resolution-Adapter
CocosCreator-Multi-resolution-Adapter
master

搜索帮助