cave background

This commit is contained in:
rsninja722 2021-04-25 17:07:04 -04:00
parent 5f2ad0b87c
commit b85c61d532
5 changed files with 47 additions and 7 deletions

BIN
assets/img/map/backBack.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

@ -28,5 +28,7 @@ void main()
vec3 tc = texture(texture0, coord).rgb; vec3 tc = texture(texture0, coord).rgb;
tc = tc + vec3(0, 0.05, 0.15);
finalColor = vec4(tc, 1.0); finalColor = vec4(tc, 1.0);
} }

View File

@ -49,13 +49,39 @@ impl InGameScreen {
}; };
// Clear the background // Clear the background
context_2d.draw_rectangle_gradient_v( // context_2d.draw_rectangle_gradient_v(
world_bounds.x as i32, // world_bounds.x as i32,
world_bounds.y as i32, // world_bounds.y as i32,
world_bounds.width as i32, // world_bounds.width as i32,
world_bounds.height as i32, // world_bounds.height as i32,
WATER, // WATER,
WATER_DARK, // WATER_DARK,
// );
context_2d.draw_texture_pro(
&game_core.resources.background_back,
Rectangle {
x: 0.0,
y: 0.0,
width: game_core.resources.background_back.width as f32,
height: game_core.resources.background_back.height as f32,
},
Rectangle::new(0.0,0.0, (game_core.resources.background_back.width * 2) as f32, (game_core.resources.background_back.height * 2) as f32),
Vector2 { x: 0.0, y: 0.0 },
0.0,
Color::WHITE,
);
context_2d.draw_texture_pro(
&game_core.resources.background_front,
Rectangle {
x: 0.0,
y: 0.0,
width: game_core.resources.background_front.width as f32,
height: game_core.resources.background_front.height as f32,
},
Rectangle::new(0.0 ,0.0, (game_core.resources.background_front.width * 2) as f32,(game_core.resources.background_front.height * 2) as f32),
Vector2 { x: 0.0, y: 0.0 },
0.0,
Color::WHITE,
); );
// Render fish // Render fish

View File

@ -31,6 +31,10 @@ pub struct GlobalResources {
// Darkness layer // Darkness layer
pub darkness_overlay: Texture2D, pub darkness_overlay: Texture2D,
// Backgrounds
pub background_front: Texture2D,
pub background_back: Texture2D,
// Shop & items // Shop & items
pub shop_background: Texture2D, pub shop_background: Texture2D,
@ -167,6 +171,14 @@ impl GlobalResources {
&thread, &thread,
&Image::load_image("./assets/img/map/darkness.png")?, &Image::load_image("./assets/img/map/darkness.png")?,
)?, )?,
background_front: raylib.load_texture_from_image(
&thread,
&Image::load_image("./assets/img/map/backFront.png")?,
)?,
background_back: raylib.load_texture_from_image(
&thread,
&Image::load_image("./assets/img/map/backBack.png")?,
)?,
shop_background: raylib.load_texture_from_image( shop_background: raylib.load_texture_from_image(
&thread, &thread,
&Image::load_image("./assets/img/map/shopHighRes.png")?, &Image::load_image("./assets/img/map/shopHighRes.png")?,