Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat
Clip sprite to parent bounds/masking? - Gideros Forum

Clip sprite to parent bounds/masking?

snookssnooks Member
edited September 2017 in General questions
I want to clip a List View to a rounded rectangle without using any overlay image. Is this possible with Gideros?


  • This is of course essential for drop down/pop up scrolling menus etc. I'm guessing that this is a feature request.

    In the search for solutions I notice that RenderTarget'ing a full screen only gets from contentWidth/Height zero left/top position and not the full screen when elements are placed with negative co-ords.
  • hgy29hgy29 Maintainer
    I would do it with new Stencil ops... I'll post something here if I find the time to give it a try
  • Thanks very much, that would be great if you could demo the new functionality for OpenGL ES virgins like me!
  • hgy29hgy29 Maintainer
    See below for an example of something that should have worked, but due to another bug in gideros won't work until 2017.8.2 (fixed it locally in my sources).
    function roundedRect(arcsize,width,height)
     local rbox=Path2D.new()
     rbox:setConvex(true) --Ensure we use the convex draw mode (doesn't use stencil)
     return rbox
    --Build our content sprite, for this test draw stripes from black to gray
    local content=Sprite.new()
    for i=0,180,20 do
    	local bar=Pixel.new((i

    Likes: talis, snooks, antix

    +1 -1 (+3 / -0 ) Share on Facebook
  • Cool, thanks very much for this - I look forward to the new release!
  • snookssnooks Member
    edited September 2017
    It's working perfectly, I have attached a gif of it in action with a menu.

    Nice one!

    Likes: pie, antix

    325 x 579 - 217K
    +1 -1 (+2 / -0 ) Share on Facebook
Sign In or Register to comment.