Repository navigation
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();
} |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
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
Worldthat 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 beCloneandDefaultwhich 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.processthat all units would get access to.Any ideas?
All reactions