mirror of
https://github.com/geode-sdk/geode.git
synced 2024-11-14 19:15:05 -05:00
new node utility functions
This commit is contained in:
parent
ac792bae31
commit
27937b5144
1 changed files with 23 additions and 0 deletions
|
@ -45,4 +45,27 @@ namespace geode::cocos {
|
|||
* Origin will be <= 0 and size will be >= 0
|
||||
*/
|
||||
GEODE_DLL cocos2d::CCRect calculateChildCoverage(cocos2d::CCNode* parent);
|
||||
|
||||
/**
|
||||
* Rescale node to fit inside given size
|
||||
* @param node Node to rescale
|
||||
* @param size Size to fit inside
|
||||
* @param def Default size
|
||||
* @param min Minimum size
|
||||
*/
|
||||
GEODE_DLL void limitNodeSize(
|
||||
cocos2d::CCNode* node,
|
||||
cocos2d::CCSize const& size,
|
||||
float def,
|
||||
float min
|
||||
);
|
||||
|
||||
/**
|
||||
* Checks if a node is visible (recursively
|
||||
* checks parent visibility)
|
||||
* @param node Node to check if visible
|
||||
* @returns True if node is visibile. Does
|
||||
* not take into account if node is off-screen
|
||||
*/
|
||||
GEODE_DLL bool nodeIsVisible(cocos2d::CCNode* node);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue