Book a Demo

Author Topic: Transparent Shapes?  (Read 3310 times)

floerio

  • EA User
  • **
  • Posts: 44
  • Karma: +0/-0
    • View Profile
Transparent Shapes?
« on: June 25, 2009, 04:06:24 pm »
Hi!

Is it possible to create shapes with a transparent background? I want to create a simple shape that depicts a frame (to group elements on a screen, like radio buttons). I need it as shape because I have to add some tagged values for documentation, therefore I can not take the EA boundary.

But every shape is filled with a definite color but this is what I want to prevent because I WANT to see the background of the groundlaying element.

Any idea?

Cheers,
Oliver

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +54/-3
    • View Profile
Re: Transparent Shapes?
« Reply #1 on: June 25, 2009, 04:31:09 pm »
You can do it in a shape script. By default, if you do something like this

Code: [Select]
shape main
{
    rectangle(0,0,100,100);
}
the rectangle is filled with the default fill colour and edged with the default border colour. If you want to change that behaviour, you can try one of the following:

Code: [Select]
shape main
{
    startpath();
    rectangle(0,0,100,100);
    endpath();
    fillpath();
}
The fillpath() command will fill the rectangle with the default fill colour but not draw the border.

Code: [Select]
shape main
{
    startpath();
    rectangle(0,0,100,100);
    endpath();
    strokepath();
}
The strokepath() command will draw the border with the default border colour but not fill the shape.

Code: [Select]
shape main
{
    startpath();
    rectangle(0,0,100,100);
    endpath();
    fillandstrokepath();
}
The fillandstrokepath() command will draw the border and fill the shape.

You want the strokepath() version.
The Sparx Team
[email protected]

floerio

  • EA User
  • **
  • Posts: 44
  • Karma: +0/-0
    • View Profile
Re: Transparent Shapes?
« Reply #2 on: June 25, 2009, 04:44:02 pm »
Yepp! That did the trick :-)

Thanks for the fast reply!

Oliver