Skip to content

Instantly share code, notes, and snippets.

@cart
Last active October 10, 2020 15:51
Show Gist options
  • Save cart/3e77d6537e1a0979a69de5c6749b6bcb to your computer and use it in GitHub Desktop.
Save cart/3e77d6537e1a0979a69de5c6749b6bcb to your computer and use it in GitHub Desktop.
Entity [
MyComponent,
Scale { x: 2.0, y: 2.0, z: 2.0 },
PropDemo {
value: "hello",
sequence: [0,1,2],
map: {field: 1.0, hello: "hi"},
nested: {field: [{test: 1.0}]}
},
// Children entities are nested
// Entities can have a specific ID
Entity(5646142) [
// this entity is empty
],
// Inserting components inside a scene patches its content
MyScene [ // basically a div
Size { width: "100%", height: "50%" } // those components are just flexbox style options
Margin { top: "25%" }
Container [
AlignContent { kind: "Center" }
Size { width: "50%" }
]
Container [
AlignContent { kind: "Center" }
Size { width: "50%" }
]
]
]
@kabergstrom
Copy link

kabergstrom commented Aug 10, 2020

Nice blog post! On the topic of scene/prefab formats, have you had a look at this? https://community.amethyst.rs/t/atelier-legion-integration-demo/1352
It supports nested prefabs, field overrides in referenced prefabs, diffs/patches for fields etc.
Looks like we've been working on similar problems in different parts of the Rust community 😄

@zutils
Copy link

zutils commented Aug 11, 2020

Hey guys, I have a few questions as I'd like to help out how I can...
Are Entity, MyScene,Container keywords? Perhaps they are structures within Bevy that are registered for usage?
Are there any current plans to use scenes within scenes - for example: QML would have "MyScene" be defined in a separate file.
Are there any current plans to add reactiveness and expressions to values? Such as width: otherContainer.width???
Are there any current plans to simplify the syntax? - instead of "50%" - just ignore the quotations?
What thoughts have been put in for the data to interact with a database?
How would a programmer know what data-types are usable?
Are there any current plans for "arrays" of entities?
I'm GUESSING that the entire scene here is more of a "template" - and Entity(5646142) is how you create a SPECIFIC entity - am I about right on that?

@karroffel
Copy link

@kabergstrom @zutils I have a feeling those comments here are a bit hard to find here as comments on a gist. There is an issue in the bevy repository which is a bit more visible than than comments here. bevyengine/bevy#92

@cart
Copy link
Author

cart commented Aug 13, 2020

Hey sorry everyone I let this get buried in my email. Lets definitely move the conversation to github. Lots of good ideas here. @zutils maybe just copy/paste your questions there and i'll answer them.

@kabergstrom: we've already synced up on this, but im definitely excited for collaboration on this front :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment