Author Topic: shapescript: add gradient to shape  (Read 3263 times)

bITs.EA

  • EA User
  • **
  • Posts: 80
  • Karma: +2/-0
    • View Profile
shapescript: add gradient to shape
« on: January 18, 2017, 03:22:58 am »
Hi

Is it possible to add a gradient property to a "fill-command"? Nativeshapes have gradient in their color, but custom shapes don't...

Thanks

Grts

S

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 7233
  • Karma: +83/-10
    • View Profile
Re: shapescript: add gradient to shape
« Reply #1 on: January 18, 2017, 09:04:05 am »
For my tests, shapes drawn by a top level shape are drawn with gradients, but subshapes they are disabled.
Eve

support@sparxsystems.com

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2738
  • Karma: +47/-3
    • View Profile
Re: shapescript: add gradient to shape
« Reply #2 on: January 18, 2017, 09:24:12 am »
I noticed that something like this

Code: [Select]
shape main
{
    ellipse(0,0,100,100);
}

doesn't have a gradient fill, but if you put it inside a path

Code: [Select]
shape main
{
    startpath();
    ellipse(0,0,100,100);
    endpath();
    fillandstrokepath();
}

it does have a gradient fill.
The Sparx Team
support@sparxsystems.com

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 7269
  • Karma: +167/-115
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: shapescript: add gradient to shape
« Reply #3 on: January 18, 2017, 10:47:59 am »
I noticed that something like this

Code: [Select]
shape main
{
    ellipse(0,0,100,100);
}

doesn't have a gradient fill, but if you put it inside a path

Code: [Select]
shape main
{
    startpath();
    ellipse(0,0,100,100);
    endpath();
    fillandstrokepath();
}

it does have a gradient fill.
Pure EAUI!

(at least it's not boring...  You never know what gotcha is round the next corner...)

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

qwerty

  • EA Guru
  • *****
  • Posts: 11202
  • Karma: +268/-248
  • I'm no guru at all
    • View Profile
Re: shapescript: add gradient to shape
« Reply #4 on: January 18, 2017, 11:09:22 am »
As we all know, the Easter bunny has its home on planet Sparx.

q.

bITs.EA

  • EA User
  • **
  • Posts: 80
  • Karma: +2/-0
    • View Profile
Re: shapescript: add gradient to shape
« Reply #5 on: January 19, 2017, 08:55:49 pm »
Check! The startpath()/endpath() solution works like a charm.