[clutter] examples: Add transparency to the rounded rectangle
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [clutter] examples: Add transparency to the rounded rectangle
- Date: Thu, 30 Apr 2015 12:20:13 +0000 (UTC)
commit e15f520a9e8a44ce45c5742caadca0698736cf0e
Author: Emmanuele Bassi <ebassi gnome org>
Date: Thu Apr 30 13:04:32 2015 +0100
examples: Add transparency to the rounded rectangle
Makes it a bit more fancy.
examples/rounded-rectangle.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/examples/rounded-rectangle.c b/examples/rounded-rectangle.c
index e9fc2fd..6ffdb4c 100644
--- a/examples/rounded-rectangle.c
+++ b/examples/rounded-rectangle.c
@@ -38,7 +38,7 @@ draw_content (ClutterCanvas *canvas,
cairo_arc (cr, x + radius, y + radius, radius, 180 * degrees, 270 * degrees);
cairo_close_path (cr);
- cairo_set_source_rgb (cr, 0.5, 0.5, 1);
+ cairo_set_source_rgba (cr, 0.5, 0.5, 1, 0.95);
cairo_fill (cr);
/* we're done drawing */
@@ -59,8 +59,10 @@ main (int argc, char *argv[])
/* create a stage */
stage = clutter_stage_new ();
clutter_stage_set_title (CLUTTER_STAGE (stage), "Rectangle with rounded corners");
+ clutter_stage_set_use_alpha (CLUTTER_STAGE (stage), TRUE);
clutter_actor_set_background_color (stage, CLUTTER_COLOR_Black);
clutter_actor_set_size (stage, 500, 500);
+ clutter_actor_set_opacity (stage, 64);
clutter_actor_show (stage);
/* our 2D canvas, courtesy of Cairo */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]