ten3roberts / flax

Batteries included ECS library for rust with entity relations and much more
78 stars 5 forks source link

component! macro visibility #8

Closed pherrymason closed 1 year ago

pherrymason commented 1 year ago

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?

pherrymason commented 1 year ago

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,
}