-
I've been having a lot of fun with the core libraries recently. Some things I still can't quite figure out:
Basically I have a canvas animation that I'm trying to overlay on top of a SVG I've yet to see any documented use of I'm just unable to set it with, for example:
Perhaps it's not exposed as I'm thinking it would be? I'm using the latest version of the core libraries. I see some other style properties pertaining to background but no method to set them, or documentation of this. ... It's hard not to notice the evolution of the core libraries and the performance and stability improvements - since just the beginning of the year! Kudos to the developers for such tremendous progress! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 11 replies
-
@0pcom Thanks for filing this. You can use the 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 Here is an example I gave to someone on Slack who wanted to render a table over an SVG widget, which you can adopt to your needs: fr := core.NewFrame(b)
fr.Styler(func(s *styles.Style) {
s.Display = styles.Custom
s.Min.Set(units.Dp(512))
})
errors.Log(core.NewSVG(fr).OpenFS(mySVG, "icon.svg"))
tb := core.NewTable(fr)
type user struct {
Name, Password string
}
tb.SetSlice(&[]user{{"Go", "hello"}, {"Python", "test"}})
tb.Styler(func(s *styles.Style) {
s.Pos.Set(units.Dp(50))
s.RenderBox = false
})
tree.AddChildInit(tb, "header", func(w *core.Frame) {
w.Styler(func(s *styles.Style) {
s.RenderBox = false
})
})
tree.AddChildInit(tb, "grid", func(w *core.ListGrid) {
w.Styler(func(s *styles.Style) {
s.RenderBox = false
})
}) Please let me know if you have any other questions. Also, thanks for the feedback on the framework! We hope to release v1 this year (#1526), and we will post more blog posts and videos soon. |
Beta Was this translation helpful? Give feedback.
@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 sets.Pos
on the child widgets to adjust the positioning if needed). You will need to sets.RenderBox = f…