Hello. Is it possible/easy to mix regular composab...
# compose
p
Hello. Is it possible/easy to mix regular composable like Text, Buttons with Canvas? I was looking to build a node-based ui (like unreal blueprint) and that would help things. Any material on the topic?
h
if you have full control over your layout logic, I mean knowing the absolute location of each view, you can use
drawBehind
on a Box and use a canvas as the background
p
Hum..I will take a look at that, thanks!
z
Yep, that should work because the draw pass happens after layout. You might want to use a custom layout instead of a Box to implement your layout logic though. Alternatively, you could use a custom SubcomposeLayout to place everything including your node composables, then pass those positions and and whatever other data you’d need to a canvas (or any composable) composed at the end for decoration.
1