Skip to content

Instantly share code, notes, and snippets.

@kengonakajima
Created February 24, 2012 09:44
Show Gist options
  • Save kengonakajima/1899785 to your computer and use it in GitHub Desktop.
Save kengonakajima/1899785 to your computer and use it in GitHub Desktop.
check any object is displayed in the window on MoaiSDK (3d and 2d)
local winx1,winy1 = fieldLayer:worldToWnd(x,y,z)
local winx2,winy2 = fieldLayer:worldToWnd(x+CELLUNITSZ*CHUNKSZ,y,z+CELLUNITSZ*CHUNKSZ)
if winx2 >= 0 and winy2 >= 0 and winx1 <= SCRW and winy1 <= SCRH then
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment