如何在cocos2d-x(c ++)ios游戏中制作关卡屏幕 [英] How to make a level screen in cocos2d-x (c++) ios game

查看:73
本文介绍了如何在cocos2d-x(c ++)ios游戏中制作关卡屏幕的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

就像我们玩愤怒的小鸟并获得关卡一样。它在屏幕上一次显示40或30个关卡。这意味着我必须创建40个CCMenuItemImage按钮。这不是最佳的优化方式。任何人都可以在这里帮助如何在屏幕上一次创建一个30级的关卡屏幕,我们还必须在每个级别按钮上显示3颗星图像(开启和关闭),就像愤怒的小鸟或任何其他级别的游戏一样。请在c ++中回答cocos2d-x

解决方案

使用按钮:为所有按钮制作图像,它可以是必须调整大小并进行修饰的屏幕截图。



通过代码创建按钮,这样你就可以使用一些循环功能来定位它们。我会把图片命名为screen00.png等等...



我发现了这个: http://stackoverflow.com/questions/1378765/how-do-i-create-a-basic-uibutton-programmatically [ ^ ]


除了手动之外,我还没有找到更好的方法。虽然您可以通过将级别选择屏幕视为另一个级别来减少脏工作,并通过 LevelHelper 或其他级别在视觉上进行设计设计师。

Just like we play angry birds and get a level screen.It shows 40 or 30 levels at a time on the screen.This means I have to create 40 CCMenuItemImage buttons.This is not the best optimized way.Can anyone here help in how to create a level screen with 30 levels at a time on the screen and also we have to show 3 stars image (on and off) on each level button just like angry birds or any other level game which has stars associated with the levels.Please answer in c++ cocos2d-x

解决方案

use buttons: make images for all buttons, it can be screenshots which you must resize and do some "polish".

Create the buttons via code, so you can use some looping funtionality to position them. I would name the pic like "screen00.png" and so on...

I found this: http://stackoverflow.com/questions/1378765/how-do-i-create-a-basic-uibutton-programmatically[^]


I have yet to find a better way of doing so other than manually. Though you could reduce the dirty work by treating the level select screen as just another level and design it visually via LevelHelper or some other level designer.


这篇关于如何在cocos2d-x(c ++)ios游戏中制作关卡屏幕的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆