@antix, I see what you mean, those are the areas shown as padding due to aspect ratio preservation, right ? Then yes, they are part of the framebuffer, so using a setClip(0,0,width,height) will clip them
Seems like I am missing something here. I just modified the jumping ball sample code, enlarging the screen area to 640 x 960 Landscape Left. I also modified the limits on the ball x from min -50, max 370, and similar with the y from min -50, max 530. I also added this in the init for the ball..
ball:setClip(0,0,320,480)
When I run the code, the ball can now move out of the screen area but does not get clipped at all. Can anyone point out what I'm missing here?
Nevermind, I figured it out. It seems that if I use stage:setClip(0, 0, 320, 480) it works like magic. Maybe the documentation could be made clearer how it works?
@antix, you are right, the way it works may not be obvious for everyone. I wasn't aware that documentation was shipped with Gideros Studio, and I believe it is not automatically synced with the official online version ( @ar2rsawseen: am I right ?).
What sprite:setClip(x,y,w,h) actually does is preventing pixels to be painted outside the box defined by x,y,w,h in sprite coordinate system. It affects only the sprite it is applied to and its children.
@hgy29, cool, thanks. I don't know what version of the documentation I have installed is. Your explanation of setClip is great and the documentation should be similar.
Now that my stage has clipping I can delete those shapes I had created that were hiding the unclipped sprites
Comments
Likes: antix
I have Gideros 2015.05.09 and setClip isn't even present in my documentation. Searched online and found it though.
ball:setClip(0,0,320,480)
When I run the code, the ball can now move out of the screen area but does not get clipped at all. Can anyone point out what I'm missing here?
Dislikes: antix
I wasn't aware that documentation was shipped with Gideros Studio, and I believe it is not automatically synced with the official online version ( @ar2rsawseen: am I right ?).
What sprite:setClip(x,y,w,h) actually does is preventing pixels to be painted outside the box defined by x,y,w,h in sprite coordinate system. It affects only the sprite it is applied to and its children.
Likes: antix
Now that my stage has clipping I can delete those shapes I had created that were hiding the unclipped sprites
will need to look at it when I'm back
Likes: antix