jjant / runty8

A Pico8 clone in Rust.
MIT License
225 stars 17 forks source link

added icon to exe for windows, and title bar + task bar for both OS #69

Closed lesleyrs closed 7 months ago

lesleyrs commented 1 year ago

Description

Created a 256x256 ico with ImageMagick, using other sizes made cmd icon blurry (directly from logo.png, I reverted the trimmed image it was too big imo). Resized so it's like 1 kb smaller. Kept the logo at 256x256 since it's a better default size unless you have a reason for it to be 240?

Works for examples and game-template:

image

image

image

image

Side notes:

  1. How do you get desktop icons on Linux? Title bar and task bar should be working there as well with winit but haven't checked myself.

  2. What's the difference between importing glutin::window::Icon and winit::window::Icon? rust analyzer only shows glutin but I just did winit since you already used winit imports.

  3. I'm not sure what this means but I haven't noticed any problems: https://github.com/nabijaczleweli/rust-embed-resource/tree/v1.8.0#errata

  4. Unrelated to this PR but why did you decide using --bin over --example? Is it to avoid them being compiled in tests? Just curious, that's the only difference I see. https://doc.rust-lang.org/cargo/reference/cargo-targets.html#binaries


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

lesleyrs commented 1 year ago

I just used the bevy book for this, it consists of 2 parts:

~There's just 1 problem with this now, winit doesn't load the image when used as a dependency like in the template or running the executable instead of cargo run. So the image has to be loaded in another way, need some help here @jjant.~

Never mind it works with relative path :D

lesleyrs commented 1 year ago

Ok this is ready for merge if it looks fine on Linux

~There's 1 small problem on windows where the icon in command prompt is low resolution. I tried various things to fix but didn't work, made an issue for it here: https://github.com/nabijaczleweli/rust-embed-resource/issues/56~

Fixed by only using 256x256 in .ico

lesleyrs commented 1 year ago

Ok now I'm really done @jjant.