Book a Demo

Author Topic: Shape script: cloud in decoration  (Read 4819 times)

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Shape script: cloud in decoration
« on: August 14, 2020, 05:27:49 pm »
Hey guys,


I'm trying to draw a cloud in a decoration, but I'm getting nothing.

Code: (ShapeScript) [Select]
decoration cloud {
orientation = "SW";

StartCloudPath(30, 15, 1.0);
Ellipse(0, 0, 100, 100);
EndPath();
StrokePath();

Print("sun");
}

The sun comes out, the cloud doesn't.

I've tried adding a main shape with DrawParentShape(), and DrawNativeShape(). I've tried making the ellipse smaller, and starting it on negative co-ordinates. Nothing doing.

Putting the exact same code in the main shape produces the cloud as expected.

Are cloud paths not supported in decorations?


/Uffe
My theories are always correct, just apply them to the right reality.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Shape script: cloud in decoration
« Reply #1 on: August 14, 2020, 06:07:53 pm »
Looks like so. See what the Sparxians will say.

q.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Shape script: cloud in decoration
« Reply #2 on: August 14, 2020, 07:18:42 pm »
Looks like so. See what the Sparxians will say.

q.
Or me...
Code: [Select]
setpen(0,0,0,1);
setfillcolor(27,254,122);
startcloudpath(3,2,2);
rectangle(20,30,80,60);
endpath();
fillandstrokepath();
draws a cloud in a decoration for me.  I think the problem is you're not using a rectange, but an ellipse.

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

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: Shape script: cloud in decoration
« Reply #3 on: August 14, 2020, 07:31:55 pm »
I think the problem is you're not using a rectange, but an ellipse.

Close, but no stogie for you. :)

It's the StartCloudPath() parameters puffWidth and puffHeight. They don't seem to scale properly, and if you plug in 30 and 15 (the defaults as documented in the API), it doesn't work.

With Pablo's more conservative 3 and 2 it works.

Code: [Select]
decoration cloud {
orientation = "SW";

StartCloudPath(3, 2, 1.0);
Ellipse(0, 0, 100, 100);
EndPath();
StrokePath();
}

So it's not the shape, it's not the position, it's not the pen and it's not the fill.

It's the puffs.

Thanks guys,


/Uffe
My theories are always correct, just apply them to the right reality.