Comments (9)
Try
fill
like this:let panel_frame = egui::Frame { fill: egui::Color32::TRANSPARENT, ..Default::default() };
OR
let panel_frame = egui::Frame { fill: egui::Color32::from_rgba_premultiplied(0, 0, 0, 50), ..Default::default() };
Hmmm, still does not work. Also i somehow don't get a windowed window, only fullscreen.
Do you have a idea what the issue is?
I tried it with this:
fn main() -> eframe::Result<()> {
env_logger::init(); // Log to stderr (if you run with `RUST_LOG=debug`).
let native_options = eframe::NativeOptions {
viewport: egui::ViewportBuilder::default()
.with_transparent(true) // Make the window transparent
.with_decorations(false)
.with_max_inner_size([200.0, 200.0])
.with_min_inner_size([100.0,100.0]),
..Default::default()
};
eframe::run_native(
"esp",
native_options,
Box::new(|cc| Box::new(RustEsp::TemplateApp::new(cc).unwrap())),
)
}
I am really confused right now.
from egui.
@rustbasic thank you for now, ill try it later :)
from egui.
I tested your source code. Temporarily use below. For the remaining functions, try using
ViewportCommand
.let native_options = eframe::NativeOptions { viewport: egui::ViewportBuilder::default() // .with_fullscreen(true) .with_inner_size(egui::vec2(800.0, 600.0)) // .with_decorations(false) .with_transparent(true), // Make the window transparent ..Default::default() };
Hello, yes this works :). But i am still really really really confused. The window is only Transparent if it opens my 2nd monitor (it does not matter if it is set as the main or secondary monitor). Same thing if i try to open the window with glfw ...
Wtf?
from egui.
So i think this issue is not about egui/eframe/glfw but about windows? Really annoying ... I can drag the window to the other monitor and the transparency works ...
from egui.
Try fill
like this:
let panel_frame = egui::Frame {
fill: egui::Color32::TRANSPARENT,
..Default::default()
};
OR
let panel_frame = egui::Frame {
fill: egui::Color32::from_rgba_premultiplied(0, 0, 0, 50),
..Default::default()
};
from egui.
You ask a question, but I don't even know what an your OS is. may be Linux.
There seems to be no problem with Windows 10.
Please find a solution in the form below.
if ui.button("transparent").clicked() {
ui.ctx()
.send_viewport_cmd(egui::ViewportCommand::Transparent(false));
}
if ui.button("innersize").clicked() {
ui.ctx()
.send_viewport_cmd(egui::ViewportCommand::InnerSize(egui::Vec2::new(500.0, 500.0)));
}
from egui.
I tested your source code.
Temporarily use below.
For the remaining functions, try using ViewportCommand
.
let native_options = eframe::NativeOptions {
viewport: egui::ViewportBuilder::default()
// .with_fullscreen(true)
.with_inner_size(egui::vec2(800.0, 600.0))
// .with_decorations(false)
.with_transparent(true), // Make the window transparent
..Default::default()
};
from egui.
@rustbasic i got a github email with your quote "Could you please apply the Pull Request below and see if it works as desired, and let me know the results?". I tried to add the branch as dependencie, got this error when i tried to cargo run:
error: failed to select a version for
objc-sys. ... required by package
objc2 v0.4.1... which satisfies dependency
objc2 = "^0.4.1"(locked to 0.4.1) of package
glutin v0.31.2... which satisfies dependency
glutin = "^0.31"(locked to 0.31.2) of package
eframe v0.27.2 (https://github.com/rustbasic/egui.git?branch=patch52#267fb5ac)`
... which satisfies git dependency eframe
of package eframe_template v0.1.0 (F:\Programming\egui-eframe-playground)
versions that meet the requirements ^0.3.1
(locked to 0.3.2) are: 0.3.2
the package objc-sys
links to the native library objc_0_3
, but it conflicts with a previous package which links to objc_0_3
as well:
package objc-sys v0.3.3
... which satisfies dependency objc-sys = "^0.3.3"
of package objc2 v0.5.1
... which satisfies dependency objc2 = "^0.5.1"
of package block2 v0.5.0
... which satisfies dependency block2 = "^0.5.0"
of package objc2-app-kit v0.2.0
... which satisfies dependency objc2-app-kit = "^0.2.0"
of package eframe v0.27.2 (https://github.com/rustbasic/egui.git?branch=patch52#267fb5ac)
... which satisfies git dependency eframe
of package eframe_template v0.1.0 (F:\Programming\egui-eframe-playground)
Only one package in the dependency graph may specify the same links value. This helps ensure that only one copy of a native library is linked in the final binary. Try to adjust your dependencies so that only one package uses the links ='objc-sys' value. For more information, see https://doc.rust-lang.org/cargo/reference/resolver.html#links.
Did i add it correctly as dependencie?
eframe = { version = "0.27.0", default-features = false, features = [
"accesskit", # Make egui comptaible with screen readers. NOTE: adds a lot of dependencies.
"default_fonts", # Embed the default egui fonts.
"glow", # Use the glow rendering backend. Alternative: "wgpu".
"persistence", # Enable restoring app state when restarting the app.
], git = "https://github.com/rustbasic/egui.git", branch = "patch52"}`
from egui.
I closed it because I didn't think it could be resolved this way.
Use ViewportCommand
to implement the functionality you want as much as possible.
from egui.
Related Issues (20)
- Gif Support HOT 1
- Custom light & dark themes on system theme change HOT 1
- Add a User-Agent header to HTTP image loader HOT 5
- Dithering in Fragment Shader HOT 1
- moving the mouse outside of the window will still cause the window to update
- Mobile web text editing tracking issue
- `include_image!` macro should take in an `expr` not a `literal`
- Phantom key presses when focusing an egui/winit window HOT 3
- Configurable plot cursor "snap" radius HOT 1
- TableBuilder / available_width() HOT 1
- Smooth zooming
- High CPU usage when accesskit enabled HOT 11
- Crashing on startup HOT 4
- Zoom out the plot with right mouse drag
- Store a Ui/Frame-stack
- Sizing-pass flag
- Wayland dependencies are pulled in for eframe, even when `wayland` feature is disabled. HOT 1
- egui_plot legend: add shortcut to hide all series but this one
- Grid layout for windows HOT 2
- Input not focused when selecting text
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from egui.