Beispiel #1
0
wySize wyNode::getFitSize() {
    float left = MAX_FLOAT;
    float right = -MAX_FLOAT;
    float top = -MAX_FLOAT;
    float bottom = MAX_FLOAT;
    for(int i = 0; i < m_children->num; i++) {
        wyNode* child = (wyNode*)wyArrayGet(m_children, i);
        left = MIN(left, child->getOriginX());
        bottom = MIN(bottom, child->getOriginY());
        right = MAX(right, child->getOriginX() + child->getWidth());
        top = MAX(top, child->getOriginY() + child->getHeight());
    }

    return wys(right - left, top - bottom);
}
Beispiel #2
0
wySize wyDirector::getWindowSize() {
	return wys(wyDevice::winWidth, wyDevice::winHeight);
}
Beispiel #3
0
wySpriteFrame* wySpriteFrame::make(float duration, wyTexture2D* tex, wyRect rect) {
	return make(duration, tex, rect, wypZero, wys(rect.width, rect.height));
}