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:
jak6jak 2021-05-05 18:45:49 +00:00
parent 4f0499b91f
commit 809877ade6
3 changed files with 7 additions and 1 deletions

View file

@ -14,13 +14,16 @@ use bevy_render::{
};
use serde::{Deserialize, Serialize};
/// General Sprite Examples: [Link](https://github.com/bevyengine/bevy/tree/latest/examples/2d)
#[derive(Debug, Default, Clone, TypeUuid, Reflect, RenderResources)]
#[render_resources(from_self)]
#[uuid = "7233c597-ccfa-411f-bd59-9af349432ada"]
#[repr(C)]
pub struct Sprite {
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,
/// When true flips sprite upside down. [Example](https://github.com/bevyengine/bevy/blob/latest/examples/2d/sprite_flipping.rs)
pub flip_y: bool,
pub resize_mode: SpriteResizeMode,
}

View file

@ -10,7 +10,9 @@ use bevy_render::{
};
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)]
#[uuid = "946dacc5-c2b2-4b30-b81d-af77d79d1db7"]
pub struct TextureAtlas {

View file

@ -21,6 +21,7 @@ use glyph_brush_layout::{HorizontalAlign, VerticalAlign};
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`.
/// [Example usage.](https://github.com/bevyengine/bevy/blob/latest/examples/2d/text2d.rs)
#[derive(Bundle, Clone, Debug)]
pub struct Text2dBundle {
pub draw: Draw,