Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Window Transparency not working #114

Open
Airyzz opened this issue May 17, 2024 · 0 comments
Open

Window Transparency not working #114

Airyzz opened this issue May 17, 2024 · 0 comments

Comments

@Airyzz
Copy link

Airyzz commented May 17, 2024

I am currently testing latest commit in master (ba5abfc) and window transparency no longer works:

image

Testing the same code but using commit b0f000d it works fine. I think it was introduced in 3159dd1

use speedy2d::color::Color;
use speedy2d::dimen::Vector2;
use speedy2d::window::{WindowCreationOptions, WindowHandler, WindowHelper};
use speedy2d::{Graphics2D, Window};

fn main() {
    let window = Window::new_with_options(
        "Title",
        WindowCreationOptions::new_windowed(
            speedy2d::window::WindowSize::PhysicalPixels(Vector2::new(500, 500)),
            None,
        )
        .with_always_on_top(true)
        .with_transparent(true),
    )
    .unwrap();
    window.run_loop(MyWindowHandler {});
}

struct MyWindowHandler {}

impl WindowHandler for MyWindowHandler {
    fn on_draw(&mut self, helper: &mut WindowHelper, graphics: &mut Graphics2D) {
        graphics.clear_screen(Color::from_rgba(0.0, 0.0, 0.0, 0.0));
        graphics.draw_circle((100.0, 100.0), 75.0, Color::BLUE);
        helper.request_redraw();
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant