Book a Demo

Author Topic: Font Colors and Shape Scripts  (Read 3812 times)

mchiuminatto

  • EA User
  • **
  • Posts: 113
  • Karma: +0/-0
    • View Profile
Font Colors and Shape Scripts
« on: December 31, 2007, 05:03:58 am »
Good day

My question is simple...is there any way to change the font color using Shape Scripts?

Thanks in advanced and best wishes for the new year.
Regards.

Marcello

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Font Colors and Shape Scripts
« Reply #1 on: December 31, 2007, 07:55:52 am »
Good news Marcello,

Yes, you can do this, and it is easy. Use the SetPenColor() method before you print your text. When you're finished you may want to reset the font color. You can do this by calling the same method, and using the GetUserFontColor() method to supply the color, or the SetDefaultColors() method, which will reset all the brush and pen colors.

HTH, David
No, you can't have it!

mchiuminatto

  • EA User
  • **
  • Posts: 113
  • Karma: +0/-0
    • View Profile
Re: Font Colors and Shape Scripts
« Reply #2 on: January 02, 2008, 06:55:23 am »
Hi David

I need font color to be white. I've tried this:

shape main
{
       
             h_align = "center";
v_align = "center";
              setfillcolor(53,103,52);
              startpath();  // Start to trace out a path
              moveto(10,20);
              lineto(10,80);
              lineto(80,80);
              lineto(80,90); //punta inferior
              lineto(90,50); //punta central de la flecha
              lineto(80,10); //punta superior
              lineto(80,20); //
              endpath();  //  End tracing out a path
              // Fill the traced path with the fill color
              fillandstrokepath();
              setpencolor(255,255,255);
            print ("#NAME#");
              return;

      }


There must be something wrong in the script because it doesn't works. By the way I'm running EA under Crossover Office and Ubuntu 7.10, maybe this is the problem.

TIA

Marcello
Regards.

Marcello

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Font Colors and Shape Scripts
« Reply #3 on: January 02, 2008, 07:47:37 am »
Hi Marcello,

I tried this in Windows and got the same results as you did. Setting the pen color seems to change the outline of a shape, but nothing I can find changes the font. The problem occurs even if another color is selected. [I checked in case white had some special handling for transparencies or something.]

It gets worse. When I use F4 on the element to set its presentation properties, EA allows me to select a new font color, but the shape does not change.

Please submit a bug report directly to Sparx. Use the Report a Bug link below the Support link at the bottom of any forum page. When you make your report please quote the title of this thread, and paste in the URL. This will allow Sparx to participate in the discussion. Of course, you should include your script as well.

If you hear back from Sparx on this problem, please post the details here so the rest of the community is in the loop.

Thanks much,
David
No, you can't have it!