bevy_pixel_camera icon indicating copy to clipboard operation
bevy_pixel_camera copied to clipboard

Is there a way to opt text out of `PixelZoom::Fixed`?

Open porkbrain opened this issue 1 year ago • 2 comments

Thanks for this plugin, done me a great service.

I am trying to render text with my PixelZoom::Fixed(3) camera. The text ends up being blurry. Can specific entities be opted out from the zoom? I'd prefer rendering the text at its original size and increasing font size myself.

porkbrain avatar Feb 25 '24 20:02 porkbrain

The scaling is done by Bevy's camera, and currently this includes the textures used to display text (there's an issue about it in Bevy's repo).

You have two solutions:

  • use a second camera (without PixelZoom), but then you have to transform your coordinates by hand (maybe I should add a helper function for this?);
  • set the scale in the transform of every text to the inverse of your PixelZoom (but then you have to remember to update the scale every time your zoom changes).

drakmaniso avatar Feb 26 '24 06:02 drakmaniso

Thank you so much for your quick response. I thought of having a second camera, but given that I wanted labels as children of moving entities, having a syncing system was not something I was too fond of.

I didn't think of the scale cancellation. It works great, thank you again. With some docs and const assigment, I hope to keep this organized until a better solution is possible with upstream bevy.

porkbrain avatar Feb 26 '24 13:02 porkbrain