Skip to content

Commit

Permalink
fix bad imports and loader.load arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
ezpuzz committed Jan 31, 2021
1 parent c7feb3c commit 1497deb
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 17 deletions.
6 changes: 0 additions & 6 deletions book/src/pong-tutorial/pong-tutorial-02.md
Original file line number Diff line number Diff line change
Expand Up @@ -382,9 +382,6 @@ fn load_sprite_sheet(world: &mut World) -> Handle<SpriteSheet> {
let texture_storage = resources.get::<AssetStorage<Texture>>();
loader.load(
"texture/pong_spritesheet.png",
ImageFormat::default(),
(),
&texture_storage,
)
};

Expand Down Expand Up @@ -464,9 +461,6 @@ fn load_sprite_sheet(world: &mut World) -> Handle<SpriteSheet> {
# let texture_storage = resources.get::<AssetStorage<Texture>>();
# loader.load(
# "texture/pong_spritesheet.png",
# ImageFormat::default(),
# (),
# &texture_storage,
# )
# };
#
Expand Down
2 changes: 1 addition & 1 deletion book/src/pong-tutorial/pong-tutorial-06.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pub struct Sounds {

/// Loads an ogg audio track.
fn load_audio_track(loader: &Loader, world: &World, file: &str) -> SourceHandle {
loader.load(file, OggFormat, (), resources.get().unwrap())
loader.load(file)
}

/// initialize audio in the world. This will eventually include
Expand Down
3 changes: 0 additions & 3 deletions book/src/sprites/load_the_texture.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ where
let loader = resources.get::<DefaultLoader>();
loader.load(
name,
ImageFormat::default(),
(),
resources.get::<AssetStorage<Texture>>(),
)
}

Expand Down
11 changes: 4 additions & 7 deletions book/src/ui/state_interaction.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ previous chapters, but here we will save the entity in our struct:
# use amethyst::{
# assets::{AssetStorage, DefaultLoader, Loader},
# ecs::{Entity, World},
# ui::{Anchor, Handle<FontAsset>, Interactable, LineMode, TtfFormat, UiText, UiTransform},
# ui::{Anchor, FontAsset, Interactable, LineMode, TtfFormat, UiText, UiTransform},
# prelude::{Builder, GameData, SimpleState, StateData},
# };
#
Expand Down Expand Up @@ -85,7 +85,7 @@ method of our state:
# use amethyst::{
# assets::{AssetStorage, DefaultLoader, Loader},
# ecs::{Entity, World},
# ui::{Anchor, Handle<FontAsset>, Interactable, LineMode, TtfFormat, UiEventType, UiText, UiTransform},
# ui::{Anchor, FontAsset, Interactable, LineMode, TtfFormat, UiEventType, UiText, UiTransform},
# prelude::{Builder, GameData, SimpleState, StateData, SimpleTrans},
# StateEvent,
# };
Expand Down Expand Up @@ -179,7 +179,7 @@ component to our button:
# assets::{AssetStorage, DefaultLoader, Loader},
# core::Hidden,
# ecs::{Entity, World},
# ui::{Anchor, Handle<FontAsset>, Interactable, LineMode, TtfFormat, UiEventType, UiText, UiTransform},
# ui::{Anchor, FontAsset, Interactable, LineMode, TtfFormat, UiEventType, UiText, UiTransform},
# prelude::{Builder, GameData, SimpleState, StateData, SimpleTrans},
# StateEvent
# };
Expand Down Expand Up @@ -269,7 +269,7 @@ The same goes for `on_resume` if we actually want to redisplay the button:
# assets::{AssetStorage, DefaultLoader, Loader},
# core::Hidden,
# ecs::{Entity, World},
# ui::{Anchor, Handle<FontAsset>, Interactable, LineMode, TtfFormat, UiEventType, UiText, UiTransform},
# ui::{Anchor, FontAsset, Interactable, LineMode, TtfFormat, UiEventType, UiText, UiTransform},
# prelude::{Builder, GameData, SimpleState, StateData, SimpleTrans},
# StateEvent
# };
Expand Down Expand Up @@ -299,9 +299,6 @@ impl SimpleState for MenuState {
# /* Create the text */
# let font_handle = resources.get::<DefaultLoader>().load(
# "font/square.ttf",
# TtfFormat,
# (),
# resources.get().unwrap(),
# );
#
# let ui_text = UiText::new(
Expand Down

0 comments on commit 1497deb

Please sign in to comment.