PXGrid // PXIndexOutOfBoundsException

1 view
Skip to first unread message

Thomas Pujolle

unread,
Oct 4, 2011, 1:12:03 PM10/4/11
to pixlib
Hello guys!

I get a PXIndexOutOfBoundsException on a PXGrid even if I just call
the function isGridCoords.
This is not very convenient as if it returns true, I don't really
care, I want to know when I'm out of bound without my code to
break ...

Is it possible to change that to return a boolean in every case?

Cheers!

public function isGridCoords(coords : Point) : Boolean
{
if ( !( coords.x >= 0 && coords.x < vSize.width && coords.y >= 0 &&
coords.y < vSize.height ) )
throw new PXIndexOutOfBoundsException(coords + " is not a valid
grid coordinates for " + this, this);

return true;
}
Reply all
Reply to author
Forward
0 new messages