How to shade a line of text?

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
MichaelBluejay
Posts: 235
Joined: Thu Jul 01, 2010 11:50 am

How to shade a line of text?

Post by MichaelBluejay » Tue Jul 27, 2010 1:19 pm

I'd like to shade certain lines of text in a list field.

I tried setting the backgroundColor of the line to a light grey, but there's not enough "padding" on the top, bottom, and left of the text, and the highlight color doesn't go wall-to-wall (all the way to the right edge of the field).

My next attempt was to draw a vector rectangle and place it over the text, but I can't find any way to make the light-grey rectangle transparent. It completely covers up the line of text.

What's a good way to shade a line of text?

While I'm at it, I can't change the backgroundColor of a rectangle with the Tool Palette after the rectangle has been created. Choosing a new color for the graphic has no effect, even though the graphic is clearly selected. Is this a bug?

Thanks for your help!

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10330
Joined: Wed May 06, 2009 2:28 pm

Re: How to shade a line of text?

Post by dunbarx » Tue Jul 27, 2010 3:17 pm

The "blendlevel" of your graphic can be set to a value between 0 and 100. Try 50.

As for changing the backGroundColor, I am not sure. With an existing graphic, it seems the tool palette has no effect, and you have to manage this either under script control or in the "fill" gadget in the "colors and patterns" pane of the inspector. The tool palette does allow new controls to be made with the effects chosen, but not, as you say, an existing one. I'll ask...

Craig Newman

Curry
Posts: 111
Joined: Mon Oct 15, 2007 11:34 pm
Contact:

Re: How to shade a line of text?

Post by Curry » Wed Jul 28, 2010 2:31 am

You may want the graphic behind your (transparent) field.
Best wishes,

Curry Kenworthy

LiveCode Development, Training & Consulting
http://livecodeconsulting.com/

WordLib: Conquer MS Word & OpenOffice
SpreadLib: "Excel-lent" spreadsheet import/export
http://livecodeaddons.com/

MichaelBluejay
Posts: 235
Joined: Thu Jul 01, 2010 11:50 am

Re: How to shade a line of text?

Post by MichaelBluejay » Wed Jul 28, 2010 10:15 am

Thanks to both of you, both these solutions worked great!

It does seem like the inability to change the color of an existing rectangle with the palette is a bug...

Post Reply