Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

Rectangle function and text

Hello, I am running an experiment where i need to have the background colour change and text change.
On sketchpad, I put the rect element around text but i need that rectangle to be filled in. The issue I am having is that when I do fill that in, I am not able to see the word. How can I fix this?


  • Hi Maria,

    If you view the script of the sketchpad (by clicking on the middle button of the three buttons at the top-right of the sketchpad and selecting 'View script'), you will see that each element has a z-index. The z-index determines which element is drawn first, such that lower z-indices are on top. So changing the z-index of the text to a lower value (e.g. -1) should cause the text to become visible again.

    Like so:

    draw rect color=red fill=1 h=128 penwidth=1 show_if=always w=192 x=-96 y=-64 z_index=0
    draw textline center=1 color=white font_bold=no font_family=serif font_italic=no font_size=32 html=yes show_if=always text=Text x=0 y=0 z_index=-1


    There's much bigger issues in the world, I know. But I first have to take care of the world I know.

Sign In or Register to comment.