Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat | DONATE
Masking & Clipping - Page 2 — Gideros Forum

Masking & Clipping

2»

Comments

  • hgy29hgy29 Maintainer
    @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

    Likes: antix

    +1 -1 (+1 / -0 )Share on Facebook
  • antixantix Member
    @hgy29, oh damn okay that is really simple. The documentation for setClip is quite confusing and unclear.

    I have Gideros 2015.05.09 and setClip isn't even present in my documentation. Searched online and found it though.
  • antixantix Member
    edited June 2015
    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?

    Dislikes: antix

    +1 -1 (+0 / -1 )Share on Facebook
  • antixantix Member
    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?
  • hgy29hgy29 Maintainer
    edited June 2015
    @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.

    Likes: antix

    +1 -1 (+1 / -0 )Share on Facebook
  • antixantix Member
    @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 :)
  • ar2rsawseenar2rsawseen Maintainer
    @hgy29 true
    will need to look at it when I'm back

    Likes: antix

    +1 -1 (+1 / -0 )Share on Facebook
Sign In or Register to comment.