How would you implement a rounded rectangle effect?



Our team wants to make a rounded rectangle decoration effect which can be applied to any actor along with other effects assuming it is the last effect.   Rather than make a rounded rect actor subclass we would like it to be an effect (trying to make it as an offscreen effect so far) for the above reason. 

With a typical rectangular actor with an image the result should be a round rectangle with that image instead.  I've been struggling with how to do this by subclassing clutter-offscreen-effect and make sure it works when you rotate the actor in any orientation.  I tried to fill a cogl rounded rectangle path but it is a 2D operation and seems to work only with identity matrix.   I'm starting to experiment with using a cogl_polygon in the shape of a rounded rect.  The other option is to do the entire effect in the offscreen texture and leave the geometry as a rectangle.  Incidently, I tried to change the size of the texture to the full size of the actor but that results in weirdness when rotating as well.  

Any advice would be appreciated.

Thanks.




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]