Skip to content

Image overlay / background image #1574

Answered by kkoreilly
0pcom asked this question in Q&A
Jul 12, 2025 · 1 comments · 11 replies
Discussion options

You must be logged in to vote

@0pcom Thanks for filing this.

You can use the s.Background property directly with any image. Notably, when I went to get the example to link to for this (https://www.cogentcore.org/core/colors#image), I noticed that it is not working, so I filed #1576.

We in fact just commented out the ZIndex property because it is not supported and is therefore confusing that it is present in the struct (#1569). However, you can use custom layout to accomplish the same effect. If you put your two widgets in a parent frame with s.Display = styles.Custom, they will render on top of each other (you can set s.Pos on the child widgets to adjust the positioning if needed). You will need to set s.RenderBox = f…

Replies: 1 comment 11 replies

Comment options

You must be logged in to vote
11 replies
@0pcom
Comment options

@0pcom
Comment options

@kkoreilly
Comment options

@0pcom
Comment options

@0pcom
Comment options

Answer selected by 0pcom
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants