Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我怎样才能找到图层的可见区域,最好是 CCRect 的形式,因为我的精灵只能在可见区域中移动,而不管背景图像的哪个部分是可见的
进一步限定“可见区域”并告诉我们更多有关您的 CCLayer/CCNode 分层设置的信息会很有用。
也就是说,我假设您已经尝试过类似的事情
CCSize size = CCDirector::sharedDirector()->getWinSize();
它为您提供屏幕框架,或
layer->getPosition() layer->getContentSize()
在您的图层上获取其边界/原点,甚至
layer->boundingBox()
这给了你一个CCRect?