PxPlus User Forum

Twitter Twitter Twitter

Author Topic: Fonted text and solid fill Shapes  (Read 700 times)

MikeinFL

  • Silver Member
  • ***
  • Posts: 35
    • View Profile
Fonted text and solid fill Shapes
« on: September 28, 2022, 02:15:08 PM »
On a panel I will sometimes create a solid fill Shape with a light color and drag it over some fonted text, to create a highlighted section.  Not as background color of the text, but to highlight a section on the panel. I want fonted text to be visible if a solid fill shape is created on top of it.   

Usually, the fonted text, which was created before the solid fill shape is visible.  But sometimes the solid fill shape hides the fonted text.  Sometimes it does.  Sometimes it doesn't.  If ithe shape hides the text I will then make a new fonted text and move it over the shape, and often that works to make the fonted text visible on the shape area. 

Is there any attribute for fonted text that makes it always visible on a filled shape?  Am I not setting something?  Thanks

 
« Last Edit: September 28, 2022, 02:16:45 PM by MikeinFL »

Mike King

  • Diamond Member
  • *****
  • Posts: 3810
  • Mike King
    • View Profile
    • BBSysco Consulting
Re: Fonted text and solid fill Shapes
« Reply #1 on: September 28, 2022, 04:46:40 PM »
The issue has to do with the order in which the items are rendered.  Generally items like text and shapes are rendered based on their position starting from the top left, proceeding left to right, top to bottom.

This means that text/shapes will be placed/drawn behind any control whose starting position is below or to the right on the same line.  For example a yellow rectangle that starts on line 5 column 10 will be drawn after (thus on top of) any other shape or text drawn above line 5 or on line 5 but to the left of column 10.

Now if you placed text at line 9.75 and you shape was on line 10, the shape would be drawn over the text making it appear to disappear. Its there, but just behind the shape.

Often we see people creating a block of text say 40 columns wide, 5 line high then try to place a colored rectangle around it.  To avoid the rectangle overlaying the text make sure the rectangles top left corner is placed before the starting position of the text block.  This will force the block to be drawn first.

Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com