Hello Everyone
I'm experiencing an issue where a render image that I've created is not being resized correctly by the virtual resolution, like all other sprites would, I've created a simple example that showcases the issue
Basically clicking anywhere on the screen will draw a red square, when the virtual resolution is the same as the window size, everything lines up correctly, but when the window size is different, and the virtual resolution kicks in to fit and center the view area the render image does not seem to receive the same treatment and so the red squares no longer line up, of course this gets more noticeable the bigger the difference in aspect ratio gets
I was wondering if anyone knows how I'd be able to compensate for this and get the red squares to line up correctly, I've tried to manually play with the size of the render image but couldn't get something that would work correctly in all situations
Thanks in advance for any help
Code demonstrating the issue follows:
global W = 800
global H = 600
SetVirtualResolution(W, H)
SetWindowSize(800, 600, 0) // Ok
//SetWindowSize(800, 800, 0) // Not ok
SetClearColor(255, 255, 255)
imgCircle = CreateImageColor(255, 0, 0, 255)
sprCircle = CreateSprite(imgCircle)
SetSpriteScale(sprCircle, 20, 20)
sprCanvas = CreateSprite(CreateRenderImage(W, H, 0, 0))
SetSpriteVisible(sprCircle, 0)
do
if (GetPointerPressed())
SetRenderToImage(GetSpriteImageID(sprCanvas), 0)
SetSpriteVisible(sprCircle, 1)
SetSpritePosition(sprCircle, GetPointerX() - GetSpriteWidth(sprCircle) / 2, GetPointerY() - GetSpriteHeight(sprCircle) / 2)
DrawSprite(sprCircle)
SetSpriteVisible(sprCircle, 0)
SetRenderToScreen()
endif
if (GetRawKeyPressed(27))
End
endif
Sync()
loop