1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
use amethyst_audio::SourceHandle;
use amethyst_core::specs::prelude::{Component, DenseVecStorage};
use amethyst_renderer::TextureHandle;
pub struct OnUiActionImage {
pub(crate) normal_image: Option<TextureHandle>,
pub(crate) hover_image: Option<TextureHandle>,
pub(crate) press_image: Option<TextureHandle>,
}
impl OnUiActionImage {
pub fn new(
normal_image: Option<TextureHandle>,
hover_image: Option<TextureHandle>,
press_image: Option<TextureHandle>,
) -> Self {
Self {
normal_image,
hover_image,
press_image,
}
}
}
impl Component for OnUiActionImage {
type Storage = DenseVecStorage<Self>;
}
pub struct OnUiActionSound {
pub(crate) hover_sound: Option<SourceHandle>,
pub(crate) press_sound: Option<SourceHandle>,
pub(crate) release_sound: Option<SourceHandle>,
}
impl OnUiActionSound {
pub fn new(
hover_sound: Option<SourceHandle>,
press_sound: Option<SourceHandle>,
release_sound: Option<SourceHandle>,
) -> Self {
Self {
hover_sound,
press_sound,
release_sound,
}
}
}
impl Component for OnUiActionSound {
type Storage = DenseVecStorage<Self>;
}