[Splashy-devel] Translucent Text Area Patch.
Pat Suwalski
pats at xandros.com
Fri Mar 17 20:37:51 UTC 2006
Pat Suwalski wrote:
> Technical details:
> - It uses a subsurface, so that if the text is too big, it's simply
> cut off.
> - I pulled out the code to determine the divider factor based on
> pixels or percent to a function that can be used anywhere in video.c.
> - It is cool. :)
I should add also that the design is with two surfaces: one is a
subsurface of the main background, and the other is a purely
non-video-memory buffer.
In the initialization function "video_start_text_area" the text box is
drawn against the background image and its translucent/modified area is
saved to a the non-video-memory surface.
Every time text is drawn, the clean tinted background is retrieved and
blitted onto the main background, then the text is drawn.
That should be a lot more efficient than copying, alpha-blitting a
rectangle, and drawing back every time.
Hopefully this eMail clarifies the technical specifics. As I say, I'm
really fond of this patch. :)
--Pat
More information about the Splashy-devel
mailing list