int MainWnd::DivWhole(const CRect &whole, int num, RECTARR &rectlst)
{
	if(num == 3 || num == 4){
		rectlst.clear();
		////ry > rx
		double rx = 0.33, ry = 0.45;
		int bwidth = whole.Width()*rx, bheight = whole.Height()*ry;
		CRect base;
		base.left = 0; base.top = 0; base.right = bwidth; base.bottom = bheight;
		CPoint mvto;
		mvto.x = whole.left; mvto.y = whole.top + ((whole.Height() - bheight)/2);
		base.MoveToXY(mvto);
		rectlst.push_back(base);
		mvto.x = whole.left + ((whole.Width() - bwidth)/2); mvto.y = whole.top;
		base.MoveToXY(mvto);
		rectlst.push_back(base);
		mvto.x = whole.right - bwidth; mvto.y = whole.top + ((whole.Height() - bheight)/2);
		base.MoveToXY(mvto);
		rectlst.push_back(base);
		mvto.x = whole.left + ((whole.Width() - bwidth)/2); mvto.y = whole.bottom - bheight;
		base.MoveToXY(mvto);
		rectlst.push_back(base);
		////5th rect: go previous
		rectlst.push_back(_setRect(whole, 0.79, 0.01, 0.99, 0.1));
		////6th rect: go next
		rectlst.push_back(_setRect(whole, 0.79, 0.11, 0.99, 0.2));
		////7th rect: newgame
		rectlst.push_back(_setRect(whole, 0.01, 0.01, 0.31, 0.1));
		////8th rect: cha
		rectlst.push_back(_setRect(whole, 0.01, 0.11, 0.31, 0.2));
		
	}
	return 0;
}
void AnimationRect::setRect(const sf::IntRect& rect) {
	undo_stack->push(*new AnimationRectChanged(this, rect));
	_setRect(rect);
}
int MainWnd::DivPlayerRect(const CRect &playerrect, RECTARR &rectlst)
{
	rectlst.clear();
	CRect ming, an, huwhole;

	rectlst.push_back(_setRect(playerrect,        0,      0.1,        1,     0.45)); //name
	rectlst.push_back(_setRect(playerrect,        0,     0.35,        1,     0.65)); //fan
	rectlst.push_back(_setRect(playerrect,      0.3,     0.02,      0.7,     0.15)); //men
	huwhole = _setRect(playerrect,      0.1,     0.6,      0.9,     0.95);
	rectlst.push_back(_setRect(huwhole,            0.255,        0,    0.745,        1)); //hu
	rectlst.push_back(_setRect(huwhole,                0,        0,     0.49,        1)); //hu left
	rectlst.push_back(_setRect(huwhole,             0.51,        0,        1,        1)); //hu right
	rectlst.push_back(ming = _setRect(playerrect,     0.02,     0.05,     0.25,      0.6)); //ming
	rectlst.push_back(_setRect(ming,              0,        0,        1,      0.5)); //ming word
	rectlst.push_back(_setRect(ming,              0,      0.5,        1,        1)); //ming cnt
	rectlst.push_back(an = _setRect(playerrect,     0.75,     0.05,     0.98,      0.6)); //an
	rectlst.push_back(_setRect(an,                0,        0,        1,      0.5)); //an word
	rectlst.push_back(_setRect(an,                0,      0.5,        1,        1)); //an cnt

	return 0;
}
Beispiel #4
0
void Block::SetSize(const LONG& s)
{
   size = s;
   _setRect();
}
Beispiel #5
0
Block::Block()
   : size(20), hp(100)
   , Object(OBJ_BLOCK, true)
{
   _setRect();
}