mirror of
https://github.com/geode-sdk/geode.git
synced 2024-11-27 01:45:35 -05:00
Merge branch 'main' of https://github.com/geode-sdk/geode
This commit is contained in:
commit
07dd379611
2 changed files with 24 additions and 0 deletions
|
@ -1022,6 +1022,11 @@ public:
|
|||
*/
|
||||
GEODE_DLL void swapChildIndices(CCNode* first, CCNode* second);
|
||||
|
||||
GEODE_DLL void setContentWidth(float width);
|
||||
GEODE_DLL void setContentHeight(float width);
|
||||
GEODE_DLL float getContentWidth() const;
|
||||
GEODE_DLL float getContentHeight() const;
|
||||
|
||||
template <class Filter, class... Args>
|
||||
geode::EventListenerProtocol* addEventListener(
|
||||
std::string const& id,
|
||||
|
|
|
@ -47,6 +47,25 @@ bool CCNode::hasAncestor(CCNode* ancestor) {
|
|||
return false;
|
||||
}
|
||||
|
||||
// these use setContentSize and getContentSize because they're virtuals and
|
||||
// some node may override those for wacky behaviour
|
||||
|
||||
void CCNode::setContentWidth(float width) {
|
||||
this->setContentSize({ width, m_obContentSize.height });
|
||||
}
|
||||
|
||||
void CCNode::setContentHeight(float height) {
|
||||
this->setContentSize({ m_obContentSize.width, height });
|
||||
}
|
||||
|
||||
float CCNode::getContentWidth() const {
|
||||
return this->getContentSize().width;
|
||||
}
|
||||
|
||||
float CCNode::getContentHeight() const {
|
||||
return this->getContentSize().height;
|
||||
}
|
||||
|
||||
CCArray* Layout::getNodesToPosition(CCNode* on) const {
|
||||
auto arr = CCArray::create();
|
||||
for (auto child : CCArrayExt<CCNode*>(on->getChildren())) {
|
||||
|
|
Loading…
Reference in a new issue