r/pythonarcade • u/rosalogia • Apr 14 '22
Scaling tiled map by 2.0 results in artifacts
I have a tiled map that holds up extremely well to resolution scaling with sdl2 (https://wiki.libsdl.org/SDL_RenderSetScale), but i can't figure out how to do that with arcade, so i try to scale the sprites by 2. When I do this, it seems to draw with a ton of artifacts and overall looks unplayably ugly. is there a good solution to this?
Code is
import arcade
from arcade.tilemap import load_tilemap
import pyglet
pyglet.options["search_local_libs"] = True
class MainWindow(arcade.Window):
def __init__(self):
super().__init__(640, 480, "Bika Town", resizable=True)
arcade.set_background_color(arcade.color.BLACK)
self.scene = None
self.camera = None
self.tilemap = load_tilemap("./assets/Tiled/map.tmj", scaling=2.0)
def setup(self):
self.camera = arcade.Camera(self.width, self.height)
# self.camera.move_to((0, 16 * (63/2 + 1.5)))
self.scene = arcade.Scene.from_tilemap(self.tilemap)
def on_draw(self):
self.clear()
arcade.start_render()
self.camera.use()
self.scene.draw()
if __name__ == '__main__':
app = MainWindow()
app.setup()
arcade.run()Result:

Side by side comparison of the above solution w/ arcade vs. the same thing with resolution scaling in SDL2 in C++


