首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >具有uikit表图层顺序的cocos2d

具有uikit表图层顺序的cocos2d
EN

Stack Overflow用户
提问于 2011-11-21 19:07:30
回答 1查看 492关注 0票数 0

我正在学习优秀的教程Integrate cocos2d and UIKit

它工作得很好,

但我需要一些精灵在我的应用程序上移动到tableView上,我已经尝试了属性z,用于cocos 2d,但似乎不能将精灵放在桌面上,

代码语言:javascript
运行
复制
tablaMenuBloq = [[[UITableView alloc]initWithFrame:CGRectMake(40, -10, 150, 210) style:UITableViewStylePlain]autorelease];
    tablaMenuBloq.transform = CGAffineTransformMakeRotation( ( 90 * M_PI ) / 180 );

    tablaMenuWrapper =[CCUIViewWrapper wrapperForUIView:tablaMenuBloq];
    [self addChild:tablaMenuWrapper];


    //first sprite
    TSprite *ez = [TSprite spriteWithFile:@"butonA.png"]; //lets create a TSprite, named EZ, and the file is Easy.png.
    [ez SetCanTrack:YES];//The sprite can be tracked.

    [self addChild: ez z:2 tag:easySprite]; //lets add a tag to the sprite, in order to identify it later
    ez.position = ccp(290,300);//position of the sprite
    [TSprite track:ez];//and lets add this sprite to the tracked array.

请注意在该表之后创建的sprite代码,

那么我该如何解决这个问题呢?

非常感谢!

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2011-11-22 22:25:17

该z索引仅存在于cocos2d视图的上下文中,并且不会影响视图与您在其上添加的子视图的关系。

参见Cocos2d node over uikit element

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/8210779

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档