xgoan
4th August 2006, 09:48
Hi,
I'm doing a map creator for a isometric game and I use a zoom (qreal) for scale the QPainter surface for zoom, also I use a QRegion (polygon not rectangle) and need to multiply the area for know the square that is below the cursor. How can I do it?
Thank's bye.
Sample code
Square *square=map.getSquare(i,j);
QRegion region(square->region());
if(square->region().contains(cursorPos)){
//if(region.contains(cursorPos)){
painter.setPen(Qt::red);
selectedSquarePosX=i; selectedSquarePosY=j;
}
I'm doing a map creator for a isometric game and I use a zoom (qreal) for scale the QPainter surface for zoom, also I use a QRegion (polygon not rectangle) and need to multiply the area for know the square that is below the cursor. How can I do it?
Thank's bye.
Sample code
Square *square=map.getSquare(i,j);
QRegion region(square->region());
if(square->region().contains(cursorPos)){
//if(region.contains(cursorPos)){
painter.setPen(Qt::red);
selectedSquarePosX=i; selectedSquarePosY=j;
}