Return 1 if on screen, else return 0.
Global code:
- Code: Select all
int inView()
{
int temp = (xscreen > - width * 0.5 && xscreen < view.width + width * 0.5 && yscreen > - height * 0.5 && yscreen < view.height + height * 0.5);
return temp;
}
Usage:
- Code: Select all
if (inView())
{
//Action here
}