Update main.py

This commit is contained in:
Yonokid
2025-04-26 02:42:34 -04:00
parent bd9f3c4ce1
commit db89298573

12
main.py
View File

@@ -17,6 +17,8 @@ class Screens:
RESULT = "RESULT" RESULT = "RESULT"
def main(): def main():
render_width, render_height = ray.get_render_width(), ray.get_render_height()
dpi_scale = ray.get_window_scale_dpi()
screen_width: int = get_config()["video"]["screen_width"] screen_width: int = get_config()["video"]["screen_width"]
screen_height: int = get_config()["video"]["screen_height"] screen_height: int = get_config()["video"]["screen_height"]
@@ -86,7 +88,15 @@ def main():
ray.end_texture_mode() ray.end_texture_mode()
ray.begin_drawing() ray.begin_drawing()
ray.clear_background(ray.WHITE) ray.clear_background(ray.WHITE)
ray.draw_texture_pro(target.texture, ray.Rectangle(0, 0, target.texture.width, -target.texture.height), ray.Rectangle(0, 0, ray.get_render_width(), ray.get_render_height()), ray.Vector2(0,0), 0, ray.WHITE) #Thanks to rnoiz proper render height
ray.draw_texture_pro(
target.texture,
ray.Rectangle(0, 0, target.texture.width, -target.texture.height),
ray.Rectangle(0, 0, int(render_width/dpi_scale.x), int(render_height)/dpi_scale.y),
ray.Vector2(0,0),
0,
ray.WHITE
)
ray.end_drawing() ray.end_drawing()
ray.close_window() ray.close_window()
audio.close_audio_device() audio.close_audio_device()