Screen not displaying full size of image

I am having troubles to make my image take up the entire screen width and height that replit comes with. I set up the turtle screen setup to match the resolution of my image that I am using as a background. The image is in .gif file format and here is a snippet of my code and the image I am using.

import turtle as trtl
import random as rand

# ----------------------------

# Turtle Setup
wn = trtl.Screen()
writer = trtl.Turtle()
imgdis = trtl.Turtle()
writer.color('#a8a0a0')
ftext = ('sans-seirf, 20, normal')
writer.pu()
wn.setup(width=700, height=400)
wn.bgpic("imagebase/back.gif")

I don’t know if replit uses compression or any ‘de-sizing’ to the resolution. But on windows property menu on the files application matches the resolution on my screen display.
image
Please ask me if you have any questions.
Thanks for your help!

@MasterLink1
What exactly do you mean “…take up the entire screen width and height that replit comes with.”
Replit doesn’t use compression or de-sizing, however, it will resize the turtle window, which auto-resizes the image (or at least that’s what most graphics libraries do).

1 Like

I think it may be because you are not using variables as they were defined. writer was the new trtl, and was then replaced with imgdis, so maybe it should be imgdis = writer.Turtle() now?
Updated code:

import turtle as trtl
import random as rand

# ----------------------------

# Turtle Setup
wn = trtl.Screen()
writer = trtl.Turtle()
imgdis = trtl.Turtle() # 'writer' is the new 'trtl'
writer.color('#a8a0a0')
ftext = ('sans-seirf, 20, normal')
imgdis.pu() # This should be changed
wn.setup(width=700, height=400)
wn.bgpic("imagebase/back.gif")
imgdis.mainloop() # If this doesn't work, try turtle.mainloop() instead. This is to not allow the drawing to disappear after it is run.

Hope this helps!

2 Likes

Is there ways to disable it?

I have mainloop, and I have writer and imgdis use it so I can have multiple turtles.

1 Like

I’ve never used turtle before so I don’t know if you can resize your screen, but if so, try use the width and height from turtle.getscreensize()?
Feel free to correct me if I am wrong tho

I fixed it. It was a problem in display size but all was fixed. Thanks for all your help!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.