mirror of
https://github.com/bevyengine/bevy
synced 2024-11-10 15:14:50 +00:00
official 2D examples linked in rustdoc (#2081)
I linked to examples within the rustdoc for the 2d examples as per issue #1934
This commit is contained in:
parent
4f0499b91f
commit
809877ade6
3 changed files with 7 additions and 1 deletions
|
@ -14,13 +14,16 @@ use bevy_render::{
|
||||||
};
|
};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
|
/// General Sprite Examples: [Link](https://github.com/bevyengine/bevy/tree/latest/examples/2d)
|
||||||
#[derive(Debug, Default, Clone, TypeUuid, Reflect, RenderResources)]
|
#[derive(Debug, Default, Clone, TypeUuid, Reflect, RenderResources)]
|
||||||
#[render_resources(from_self)]
|
#[render_resources(from_self)]
|
||||||
#[uuid = "7233c597-ccfa-411f-bd59-9af349432ada"]
|
#[uuid = "7233c597-ccfa-411f-bd59-9af349432ada"]
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
pub struct Sprite {
|
pub struct Sprite {
|
||||||
pub size: Vec2,
|
pub size: Vec2,
|
||||||
|
/// When true flips sprite to left. [Example](https://github.com/bevyengine/bevy/blob/latest/examples/2d/sprite_flipping.rs)
|
||||||
pub flip_x: bool,
|
pub flip_x: bool,
|
||||||
|
/// When true flips sprite upside down. [Example](https://github.com/bevyengine/bevy/blob/latest/examples/2d/sprite_flipping.rs)
|
||||||
pub flip_y: bool,
|
pub flip_y: bool,
|
||||||
pub resize_mode: SpriteResizeMode,
|
pub resize_mode: SpriteResizeMode,
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,9 @@ use bevy_render::{
|
||||||
};
|
};
|
||||||
use bevy_utils::HashMap;
|
use bevy_utils::HashMap;
|
||||||
|
|
||||||
/// An atlas containing multiple textures (like a spritesheet or a tilemap)
|
/// An atlas containing multiple textures (like a spritesheet or a tilemap).
|
||||||
|
/// [Example usage animating sprite.](https://github.com/bevyengine/bevy/blob/latest/examples/2d/sprite_sheet.rs)
|
||||||
|
/// [Example usage loading sprite sheet.](https://github.com/bevyengine/bevy/blob/latest/examples/2d/texture_atlas.rs)
|
||||||
#[derive(Debug, RenderResources, TypeUuid)]
|
#[derive(Debug, RenderResources, TypeUuid)]
|
||||||
#[uuid = "946dacc5-c2b2-4b30-b81d-af77d79d1db7"]
|
#[uuid = "946dacc5-c2b2-4b30-b81d-af77d79d1db7"]
|
||||||
pub struct TextureAtlas {
|
pub struct TextureAtlas {
|
||||||
|
|
|
@ -21,6 +21,7 @@ use glyph_brush_layout::{HorizontalAlign, VerticalAlign};
|
||||||
use crate::{DefaultTextPipeline, DrawableText, Font, FontAtlasSet, Text, Text2dSize, TextError};
|
use crate::{DefaultTextPipeline, DrawableText, Font, FontAtlasSet, Text, Text2dSize, TextError};
|
||||||
|
|
||||||
/// The bundle of components needed to draw text in a 2D scene via a 2D `OrthographicCameraBundle`.
|
/// The bundle of components needed to draw text in a 2D scene via a 2D `OrthographicCameraBundle`.
|
||||||
|
/// [Example usage.](https://github.com/bevyengine/bevy/blob/latest/examples/2d/text2d.rs)
|
||||||
#[derive(Bundle, Clone, Debug)]
|
#[derive(Bundle, Clone, Debug)]
|
||||||
pub struct Text2dBundle {
|
pub struct Text2dBundle {
|
||||||
pub draw: Draw,
|
pub draw: Draw,
|
||||||
|
|
Loading…
Reference in a new issue