Just been having a mess with this trying all sorts of stuff for the %age system but everything I try at 1 pixel wide for the grid it does the same unless full screen and at 1.4 pixels or more there is no problem so I can only think it is due to the resizing when rendering on the screen.
Have you tried the virtual screen instead? Going to try it in a bit.
Heres what I got when over complicating it to try dif things
// Project: Display Aspect Test
// Created: 2016-01-09
// set window properties
global screenWidth# as float
global screenHeight# as float
global xPixel# as float
global yPixel# as float
global blockSizeX# as float
global blockSizeY# as float
screenWidth# = GetMaxDeviceWidth()
screenHeight# = GetMaxDeviceHeight()
aspect# = screenWidth#/screenHeight#
SetDisplayAspect(aspect#)
SetWindowTitle( "Display Aspect Test" )
xPixel# = 100.0/screenWidth#
yPixel# = 100.0/screenHeight#
lineWeightPixels# = 1 // Change this to pixel size of width of line for grid 1 = 1 pixel 2 = 2 pixels wide etc
lineSizeX# = lineWeightPixels# * xPixel#
lineSizeY# = lineWeightPixels# * yPixel#
percentageX = 4
percentageY = 5
onePercentX# = screenWidth#/100.0
onePercentY# = screenHeight#/100.0
blockSizeX# = xPixel# * (onePercentX# * percentageX)
blockSizeY# = yPixel# * (onePercentY# * percentageY)
CreateGrid(25, lineSizeX#, lineSizeY#)
CreateGrid(20, lineSizeX#, lineSizeY#)
do
MouseX# = GetPointerX()
MouseY# = GetPointerY()
Print("MouseX: " + str (MouseX#) + " MouseY: " + str (MouseY#))
if GetRawKeyPressed(27) // Check for Esc key
DeleteAllSprites()
DeleteAllImages()
End
endif
Print( ScreenFPS() )
Sync()
loop
Function CreateGrid(gridCount, lineSizeX#, lineSizeY#)
for grid = 1 to gridCount
gridSprite = CreateSprite(0)
if gridCount = 25
SetSpriteSize(gridSprite, lineSizeX#, screenHeight#)
SetSpritePosition(gridSprite, grid * blockSizeX#, 0)
else
SetSpriteSize(gridSprite, screenWidth#, lineSizeY#)
SetSpritePosition(gridSprite, 0, grid * blockSizeY#)
endif
next grid
endfunction