; CaptureError Example ; -------------------- ; Requires Extended mode. Graphics3D 640,480,0,2 SetBuffer BackBuffer() camera=CreateCamera() PositionEntity camera,0,1,-6 light=CreateLight() RotateEntity light,45,45,0 trophy=CreateSphere(24) EntityColor trophy,120,220,120 While Not KeyDown(1) ; Space arms a valid PNG screenshot If KeyHit(57) Then CaptureScreenshot "capture_example.png" ; J tries an unsupported .jpg capture, which is rejected If KeyHit(36) Then CaptureScreenshot "capture_example.jpg" TurnEntity trophy,0.5,1.5,0 ; Arrow keys move the camera If KeyDown(200) Then MoveEntity camera,0,0,0.1 If KeyDown(208) Then MoveEntity camera,0,0,-0.1 If KeyDown(203) Then TurnEntity camera,0,1,0 If KeyDown(205) Then TurnEntity camera,0,-1,0 RenderWorld Text 0,0,"Arrow keys: move camera Space: PNG capture J: JPG capture Esc: exit" ; CaptureError explains the latest rejected or failed capture If CaptureError()<>"" Then Text 0,20,"CaptureError() = "+CaptureError() Else Text 0,20,"CaptureError() is empty - no capture has failed" Flip Wend End