I’ve tried a bunch of settings with sprite. Centered on/off - but no luck.
EDIT : The position is also set to 0,0 for the sprite and i’ve tried some combinations to get this to work - i.e centered on/off , position change and viewport related settings. The main issue is as soon as scroll scale is set to 0,0 - bg disappears (to start with)
I don’t believe this is the reason. In the attached screenshot, you can see the position is set to 0,0.
I’ve tried a few combinations or tinkered with settings. These include viewport, centered, and position. As soon as the scroll scale is set to 0,0 the bg disappears.
Offset/centered position can show it well - offset , but this does not work either.
I’m not able to reproduce any issue with a similar setup as yours. Are you moving the Node2D root node? For example by instantiating it in another scene and moving it.
From what it looks like, you probably are doing something funky with zoom (I’m guessing, since I can’t see your viewport box and it’s not the same size as your camera box)? In that case, the section you want is “poor sizing”.
Normally, you build your game around your viewport and target resolution and you zoom in and out as an effect. Setting the texture to 0,0 will do essentially the same thing as a CanvasLayer and stay in the top left of the viewport. What it looks like is that your background doesn’t fit your viewport, it only fits your zoomed in camera. If you don’t want to fix your resolution or zoom, then you’ll need to put your background in the center of your viewport, which is what will be displayed when you zoom in.
Hello! I appreciate you taking the time to look at my issue and the repository. I understand partially how to resolve this. I grasp that using Zoom to enforce a resolution is a bad idea, but I can explain what I am trying to do. Sorry if we are going slightly off-topic into viewports/cameras.
One of the tutorials I am following recommended a way of choosing a resolution by using the zoom factor on the camera.
My display is 2560x1440 - So to enforce the width of 640x360, the camera applies a zoom (4,4) to it.
I certainly don’t have any qualms about changing the viewport or camera to the above resolution, but I guess I am trying to figure out how to set it up correctly so I can get the same view as you have attached.
I’ve tried the following.
Update the viewport size to 640 x 360 (Project→Display)
Set zoom back to 1,1 (Camera)
Tried to move the image into the camera, but it always launches with the below full-scale resolution.
The main culprit is that you have the viewport stretch set to “Disabled” which means that it will never enforce a size. It’ll always match the size of your window. Setting it to any of the others will fix that.