https://github.com/jerryshell/windows-ez-overlay
Windows EZ Overlay for Rust 🦀
https://github.com/jerryshell/windows-ez-overlay
overlay rust windows
Last synced: 10 months ago
JSON representation
Windows EZ Overlay for Rust 🦀
- Host: GitHub
- URL: https://github.com/jerryshell/windows-ez-overlay
- Owner: jerryshell
- License: agpl-3.0
- Created: 2024-01-06T19:39:02.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2025-02-26T09:23:55.000Z (12 months ago)
- Last Synced: 2025-03-27T22:43:18.074Z (11 months ago)
- Topics: overlay, rust, windows
- Language: Rust
- Homepage:
- Size: 44.9 KB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Windows EZ Overlay for Rust 🦀
Windows Direct2D overlay
## How to use
1. Cargo.toml
```toml
windows-ez-overlay = { git = "https://github.com/jerryshell/windows-ez-overlay" }
```
2. Rust code
```rust
// init draw_rect_list, ez-overlay will draw Rectangle using draw_rect_list
let draw_rect_list = Arc::new(RwLock::new(Vec::::with_capacity(32)));
// get target window info
let game_window = FindWindowA(None, s!("AssaultCube"));
let mut window_info = WINDOWINFO::default();
GetWindowInfo(game_window, &mut window_info);
// init ez-overlay with window_info and draw_rect_list
let draw_rect_list_clone = Arc::clone(&draw_rect_list);
std::thread::spawn(move || {
let mut overlay = windows_ez_overlay::Overlay::new(
window_info.rcClient.left,
window_info.rcClient.top,
window_info.rcClient.right,
window_info.rcClient.bottom,
draw_rect_list_clone,
true,
).unwrap();
overlay.run().unwrap();
});
// ... do your stuff ...
{
let mut draw_rect_list = draw_rect_list.write().unwrap();
// update draw_rect_list from here
}
```
## Test
```bash
cargo test
```
## Example
[ac-esp | AssaultCube ESP DLL with Rust 🦀](https://github.com/jerryshell/ac-esp)
## License
[GNU Affero General Public License v3.0](LICENSE)