This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[dependencies] | |
gl = "*" | |
glutin = "0.26" | |
winit = "0.24" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Shows the basics of reading a pixel color value from an `Image` in Bevy | |
/// Pass in a handle to indicate which `Image` you're interested in | |
/// In this example I'm passing in a `LevelHandle` to snag an image used for a level | |
pub(crate) fn read_pixel( | |
query: Query<&Handle<Image>, With<LevelHandle>>, | |
images: Res<Assets<Image>>, | |
) { | |
let handle = query.single(); | |
// the coordinates should be passed in through a Query |
OlderNewer