Replies: 1 comment
-
Well, strangely enough this may have been simpler than I thought it was going to be. With #62 you can do this, which is essentially an ideal user experience I think: fn popup(ctx: WidgetContext) -> WidgetNode {
// Get the ECS world from the process context
let world = ctx.process_context.get::<World>().unwrap();
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
OK, so I've finally gotten to the point of trying to integrate my RAUI UI with my ECS world! Now I've got a problem to solve. :)
I need a way to inject a borrow to the ECS
World
that can be accessed by the widgets ( duringapp.process()
I think is the only time the widget's need it ) and then remove the borrow to the world so that the rest of the ECS systems can continue on their way.The natural attempt would be to try and put it in a
Prop
, but the issue with that is that props must beClone
andDefault
which doesn't make sense in this case: I have mutable reference that cannot be cloned and has no default and must only exist for the duration ofapp.process()
.My initial thought on a possible solution is to pass a sort of context struct into
app.process
that all units would get access to.Any ideas?
Beta Was this translation helpful? Give feedback.
All reactions