Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upFeature/634/sprite rendering and animation #638
Conversation
azriel91
changed the title from
WIP: Feature/634/sprite rendering and animation
to
Feature/634/sprite rendering and animation
Apr 13, 2018
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
woo it works |
Xaeroxe
self-requested a review
Apr 13, 2018
azriel91
changed the title from
Feature/634/sprite rendering and animation
to
[WIP] Feature/634/sprite rendering and animation
Apr 14, 2018
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
WIP: rebasing over Rhuagh's animation implementation. |
azriel91
changed the title from
[WIP] Feature/634/sprite rendering and animation
to
Feature/634/sprite rendering and animation
Apr 15, 2018
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
azriel91
Apr 15, 2018
Contributor
Updated to work with the new animation types, had to edit the Flat passes, I'm not sure if I should've used the function or just added the AlbedoOffset buffer. Screenshot is on the first comment.
Appveyor build failure is due to something wrong with the window installer download
|
Updated to work with the new animation types, had to edit the Flat passes, I'm not sure if I should've used the function or just added the AlbedoOffset buffer. Screenshot is on the first comment. Appveyor build failure is due to something wrong with the window installer download |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
azriel91
Apr 17, 2018
Contributor
Yeaps
- #641 adds the material animation (texture, and texture coordinates)
- #644 adds delayed start over animations
- This adds sprites, and takes advantage of the material animation to pick a texture and shift the texture coordinates.
I had this idea, though not sure if I'll do it soon -- I have a self-imposed deadline for something in 1.5 weeks:
- Split the bat sprite sheet into two
- Make the grey bat evolve into the brown bat by swapping the texture id in the animation
|
Yeaps
I had this idea, though not sure if I'll do it soon -- I have a self-imposed deadline for something in 1.5 weeks:
|
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Ready for review |
jojolepro
requested changes
Apr 23, 2018
This looks pretty good, nice job!
A much needed feature.
| @@ -59,6 +59,7 @@ thread_profiler = { version = "0.1", optional = true } | ||
| amethyst_gltf = { path = "amethyst_gltf", version = "0.1" } | ||
| genmesh = "0.5" | ||
| amethyst_animation = { path = "amethyst_animation", version = "0.1.0" } | ||
| +ron = "0.1" |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
azriel91
Apr 23, 2018
Contributor
To keep it consistent with amethyst_assets and amethyst_config. Generally within a repo I try to keep the same dependency versions
azriel91
Apr 23, 2018
Contributor
To keep it consistent with amethyst_assets and amethyst_config. Generally within a repo I try to keep the same dependency versions
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
jojolepro
Apr 23, 2018
Collaborator
okay, then we might want to update it in a future PR. For this one you can keep 0.1
jojolepro
Apr 23, 2018
Collaborator
okay, then we might want to update it in a future PR. For this one you can keep 0.1
| +/// These should be in normalized coordinates: | ||
| +/// | ||
| +/// * X axis: 0.0 is the left side and 1.0 is the right side. | ||
| +/// * Y axis: 0.0 is the top and 1.0 is the botoom. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
| +/// * X axis: 0.0 is the left side and 1.0 is the right side. | ||
| +/// * Y axis: 0.0 is the top and 1.0 is the botoom. | ||
| +#[derive(Clone, Debug)] | ||
| +pub struct Sprite { |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
jojolepro
Apr 23, 2018
Collaborator
An implement of the From trait for ((f32,f32),(f32,f32)) and [f32,4] could be useful I think.
jojolepro
Apr 23, 2018
Collaborator
An implement of the From trait for ((f32,f32),(f32,f32)) and [f32,4] could be useful I think.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
| +use amethyst_animation::{get_animation_set, AnimationBundle, AnimationCommand, EndControl, | ||
| + MaterialTextureSet}; | ||
| + | ||
| +const BACKGROUND_COLOUR: [f32; 4] = [0.0, 0.0, 0.0, 0.0]; // black |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
| + let entity = world | ||
| + .create_entity() | ||
| + // The default `Material`, whose textures will be swapped based on the animation. | ||
| + .with(sprite_sheet_material.clone()) |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
azriel91
Apr 23, 2018
Contributor
Yeap, because the loop creates multiple entities, and each of them have their own material component
azriel91
Apr 23, 2018
Contributor
Yeap, because the loop creates multiple entities, and each of them have their own material component
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
| +/// | ||
| +/// * `index`: Index of the sprite sheet's texture in the `MaterialTextureSet`. | ||
| +/// * `definition`: Definition of the sprite layout on the sprite sheet. | ||
| +pub fn load(index: usize, definition: &sprite::SpriteSheetDefinition) -> SpriteSheet { |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
jojolepro
Apr 23, 2018
Collaborator
Shouldn't that be directly into the engine? It seems pretty inconvenient to code this each time you make a new project.
jojolepro
Apr 23, 2018
Collaborator
Shouldn't that be directly into the engine? It seems pretty inconvenient to code this each time you make a new project.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
azriel91
Apr 23, 2018
Contributor
the SpriteSheetDefinition is user defined, based on #634 (comment), so it has to be outside
azriel91
Apr 23, 2018
Contributor
the SpriteSheetDefinition is user defined, based on #634 (comment), so it has to be outside
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Xaeroxe
approved these changes
Apr 23, 2018
I have nothing more to add, @jojolepro already said everything I saw.
azriel91
added some commits
Apr 11, 2018
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
bors r=@jojolepro, @Xaeroxe |
bot
added a commit
that referenced
this pull request
Apr 23, 2018
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
bors
bot
merged commit d8bf0e0
into
amethyst:develop
Apr 23, 2018
azriel91
deleted the
azriel91:feature/634/sprite-rendering-and-animation
branch
Apr 24, 2018
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Congratz! |
azriel91 commentedApr 12, 2018
•
edited
Edited 4 times
-
azriel91
edited Apr 22, 2018 (most recent)
-
azriel91
edited Apr 15, 2018
-
azriel91
edited Apr 13, 2018
-
torkleyy
edited Apr 12, 2018
Attempt at sprite animation: #634. This is branched off #641.
This change is