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
Halil Ozercan
06/28/2021, 10:40 AM
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
Paulo Pinheiro
06/28/2021, 12:12 PM
Hum..I will take a look at that, thanks!
z
Zach Klippenstein (he/him) [MOD]
06/28/2021, 2:54 PM
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.