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
use raylib::prelude::*;
use nalgebra as na;
use crate::{
discord::DiscordChannel, global_resource_package::GlobalResources,
rendering::utilities::anim_texture::AnimatedTexture,
};
#[derive(Debug)]
pub struct TestFoxScene {
fox_animation: AnimatedTexture,
}
impl TestFoxScene {
pub fn new(raylib_handle: &mut RaylibHandle, thread: &RaylibThread) -> Self {
let fox = AnimatedTexture::new(raylib_handle, thread, "chr", "testFox").unwrap();
Self { fox_animation: fox }
}
pub fn render_frame(
&mut self,
raylib: &mut RaylibHandle,
rl_thread: &RaylibThread,
discord: &DiscordChannel,
global_resources: &GlobalResources,
) {
let mut draw = raylib.begin_drawing(rl_thread);
draw.clear_background(Color::WHITE);
self.fox_animation.render_automatic(
&mut draw,
na::Vector2::new(0.0, 0.0),
None,
None,
None,
None,
);
}
}