Quantcast
Channel: Question and Answer » libgdx
Viewing all articles
Browse latest Browse all 434

Java libgdx get clicked square without iter

$
0
0

square grid

I would like to detect which square is clicked without iterating over all elements!

i don’t want to do this anymore for all elements.

 if( x >= this.getAnchorX()-HalfWidth  && x <= this.getAnchorX()+HalfWidth  && y <= this.getAnchorY()+HalfHeight && y >= this.getAnchorY()-HalfHeight )
        return true;
    else return false;

Viewing all articles
Browse latest Browse all 434

Trending Articles