ten3roberts/flax

component! macro visibility

Closed this issue · 1 comments

I have a components.rs file where I define my components:

component! {
    scene: Scene,
    name: String,
    description: String,
    sprite: Sprite,
    transform: Transform,
}

Now, from another file I want to be able to spawn entities with these components, but they are not accessible.

How can I import the component definitions there where I need to use them?

Ok, nevermind, I just saw I can specify visibility on components definitions:

component! {
    pub scene: Scene,
    pub name: String,
    pub description: String,
    pub sprite: Sprite,
    pub transform: Transform,
}