Exemplo n.º 1
0
	virtual Pint GtoF(const Pint& _gpos,const dxO& _dxo)const{return _dxo.GtoD(_gpos);}
Exemplo n.º 2
0
	virtual int drawIn(dxO& _dxo,DrawFuncType* _pDrawFunc){
		_dxo.movePos(-viewpos);
		int ans=(*_pDrawFunc)(_dxo);
		Rint rect=_dxo.getArea();
		adjDrawArea(rect);
		_dxo.movePos(viewpos);

		if(rect.pos1.x<viewpos.x){
			dxoBox tmpbox(Pint(10,MoveAreaSize.y),MoveAreaClr);
			if(tmpbox.pIn(Pint(0,0),_dxo.GtoD(dx::getMosPos())) && _dxo.checkActive()){
				_dxo.draw(Pint(0,0),tmpbox,true,196);
				_dxo.draw(Pint(0,MoveAreaSize.y/2),dxoTriangle(Pint(10,-7),Pint(10,7),MoveAreaClr),true,196);
				if(dx::getMosL()>0)viewpos.x-=10;
				else if(dx::getMosR()>0)viewpos.x=rect.pos1.x;
				else viewpos.x-=2;
			}else{
				_dxo.draw(Pint(0,0),tmpbox,true,128);
				_dxo.draw(Pint(0,MoveAreaSize.y/2),dxoTriangle(Pint(10,-7),Pint(10,7),MoveAreaClr),true,128);
			}
		}
		if(rect.pos1.y<viewpos.y){
			dxoBox tmpbox(Pint(MoveAreaSize.x,10),MoveAreaClr);
			if(tmpbox.pIn(Pint(0,0),_dxo.GtoD(dx::getMosPos())) && _dxo.checkActive()){
				_dxo.draw(Pint(0,0),tmpbox,true,196);
				_dxo.draw(Pint(MoveAreaSize.x/2,0),dxoTriangle(Pint(-7,10),Pint(7,10),MoveAreaClr),true,196);
				if(dx::getMosL()>0)viewpos.y-=10;
				else if(dx::getMosR()>0)viewpos.y=rect.pos1.y;
				else viewpos.y-=2;
			}else{
				_dxo.draw(Pint(0,0),tmpbox,true,128);
				_dxo.draw(Pint(MoveAreaSize.x/2,0),dxoTriangle(Pint(-7,10),Pint(7,10),MoveAreaClr),true,128);
			}
		}
		if(rect.pos2.x>viewpos.x+MoveAreaSize.x){
			dxoBox tmpbox(Pint(10,MoveAreaSize.y),MoveAreaClr);
			if(tmpbox.pIn(Pint(MoveAreaSize.x-10,0),_dxo.GtoD(dx::getMosPos())) && _dxo.checkActive()){
				_dxo.draw(Pint(MoveAreaSize.x-10,0),tmpbox,true,196);
				_dxo.draw(Pint(MoveAreaSize.x,MoveAreaSize.y/2),dxoTriangle(Pint(-10,-7),Pint(-10,7),MoveAreaClr),true,196);
				if(dx::getMosL()>0)viewpos.x+=10;
				else if(dx::getMosR()>0)viewpos.x=rect.pos2.x-MoveAreaSize.x;
				else viewpos.x+=2;
			}else{
				_dxo.draw(Pint(MoveAreaSize.x-10,0),tmpbox,true,128);
				_dxo.draw(Pint(MoveAreaSize.x,MoveAreaSize.y/2),dxoTriangle(Pint(-10,-7),Pint(-10,7),MoveAreaClr),true,128);
			}
		}
		if(rect.pos2.y>viewpos.y+MoveAreaSize.y){
			dxoBox tmpbox(Pint(MoveAreaSize.x,10),MoveAreaClr);
			if(tmpbox.pIn(Pint(0,MoveAreaSize.y-10),_dxo.GtoD(dx::getMosPos())) && _dxo.checkActive()){
				_dxo.draw(Pint(0,MoveAreaSize.y-10),tmpbox,true,196);
				_dxo.draw(Pint(MoveAreaSize.x/2,MoveAreaSize.y),dxoTriangle(Pint(-7,-10),Pint(7,-10),MoveAreaClr),true,196);
				if(dx::getMosL()>0)viewpos.y+=10;
				else if(dx::getMosR()>0)viewpos.y=rect.pos2.y-MoveAreaSize.y;
				else viewpos.y+=2;
			}else{
				_dxo.draw(Pint(0,MoveAreaSize.y-10),tmpbox,true,128);
				_dxo.draw(Pint(MoveAreaSize.x/2,MoveAreaSize.y),dxoTriangle(Pint(-7,-10),Pint(7,-10),MoveAreaClr),true,128);
			}
		}

		return 0;
	}