dante
dante

Reputation: 1254

Can I use a Widget as a actual component in Flutter Flame

Can Flutter Flame render Widget inside game world like other components? (not overlay widget).

(I want to apply forge2d physic to widget and I'm trying to do it with Flame.)

Upvotes: 2

Views: 1987

Answers (1)

spydon
spydon

Reputation: 11512

You can not, you can only do it through the overlay system or use a Stack, but the widgets are never "in" the game, but on top of the game. The game can only have Flame Components added directly to it.

You can still interact with the overlay widgets from the game though, like this for example: https://twitter.com/spydon/status/1417832832693673988

In that example I simply wrap the ElevatedButton with Positioned and Transform and then I updated those with the values from corresponding BodyComponents.

Upvotes: 6

Related Questions