CENTERED THE THING (grid up next)
This commit is contained in:
19
src/main.rs
19
src/main.rs
@@ -6,18 +6,28 @@ fn main() {
|
|||||||
|
|
||||||
let _rust_orange = Color::new(222, 165, 132, 255);
|
let _rust_orange = Color::new(222, 165, 132, 255);
|
||||||
let _ray_white = Color::new(255, 255, 255, 255);
|
let _ray_white = Color::new(255, 255, 255, 255);
|
||||||
|
//images
|
||||||
let board_image = Image::load_image("resouces/board.png").expect("WHAT DA HAILLL");
|
let board_image = Image::load_image("resouces/board.png").expect("WHAT DA HAILLL");
|
||||||
let _ = rl
|
let _ = rl
|
||||||
.load_texture(&thread, "resouces/board.png")
|
.load_texture(&thread, "resouces/board.png")
|
||||||
.expect("couldn't load texture :(");
|
.expect("couldn't load texture :(");
|
||||||
|
|
||||||
|
let _ = rl
|
||||||
|
.load_texture(&thread, "resouces/bracc.png")
|
||||||
|
.expect("couldn't load texture :(");
|
||||||
|
|
||||||
|
let circle_image = Image::load_image("resouces/bracc.png").expect("WHAT DA HAILLL");
|
||||||
|
let _ = rl
|
||||||
|
.load_texture(&thread, "resouces/bracc.png")
|
||||||
|
.expect("couldn't load texture :(");
|
||||||
|
//textures
|
||||||
let board_texture = rl
|
let board_texture = rl
|
||||||
.load_texture_from_image(&thread, &board_image)
|
.load_texture_from_image(&thread, &board_image)
|
||||||
.expect("WHAT DA HAILL");
|
.expect("WHAT DA HAILL");
|
||||||
println!(
|
|
||||||
"width: {} \n height: {}.",
|
let circle_texture = rl
|
||||||
board_texture.width, board_texture.height
|
.load_texture_from_image(&thread, &circle_image)
|
||||||
);
|
.expect("WHAT DA HAILL");
|
||||||
let square_widf = board_texture.width / NROW;
|
let square_widf = board_texture.width / NROW;
|
||||||
let square_heif = board_texture.height / NCOL;
|
let square_heif = board_texture.height / NCOL;
|
||||||
let square_wewant = (square_widf * NROW / 2, square_heif * 3 / 2);
|
let square_wewant = (square_widf * NROW / 2, square_heif * 3 / 2);
|
||||||
@@ -30,6 +40,7 @@ fn main() {
|
|||||||
d.clear_background(Color::WHITE);
|
d.clear_background(Color::WHITE);
|
||||||
//d.draw_circle_gradient(240, 240, 100 as f32, Color::ORANGE, Color::RED);
|
//d.draw_circle_gradient(240, 240, 100 as f32, Color::ORANGE, Color::RED);
|
||||||
d.draw_circle(square_wewant.0, square_wewant.1, 55.0, Color::YELLOW);
|
d.draw_circle(square_wewant.0, square_wewant.1, 55.0, Color::YELLOW);
|
||||||
|
d.draw_texture(&circle_texture, 7, 9, Color::VIOLET);
|
||||||
d.draw_texture(&board_texture, 0, 0, Color::VIOLET);
|
d.draw_texture(&board_texture, 0, 0, Color::VIOLET);
|
||||||
if let Some(pressed_key) = pressed_key {
|
if let Some(pressed_key) = pressed_key {
|
||||||
// Certain keyboards may have keys raylib does not expect. Uncomment this line if so.
|
// Certain keyboards may have keys raylib does not expect. Uncomment this line if so.
|
||||||
|
|||||||
Reference in New Issue
Block a user