Createscreen broken for thin sprites/screens

Previous topic - Next topic

FutureCow

Createscreen seems to be broken. The following code creates a screen 10x30 and fills it with yellow. Afterwards it draws 100 of them on the screen.
If you change the "X=10" to make the rectangle smaller, it works for "X=9", but when X=8, all the rectangles disappear.

This has been causing me a lot of problems over the past day as the Kerned Font routine I'm writing is using CREATESCREEN to create a sprite 1 pixel wide and by the looks of it, this is the cause.

Can people please test if this breaks on their computers? (Confirm it works as written, then change "X=10" to "X=8" and see if the yellow boxes no longer appear) - ESC to quit.
I'm running WinXP SP3, GLBasic IDE, Version: 7.322

Code (glbasic) Select
LOCAL ScreenImage
ScreenImage=GENSPRITE()

LOCAL X
X=10


CREATESCREEN 1, ScreenImage, X, 30 // First pass, we create our sprite to do collision checks against as a single pixel
USESCREEN 1
DRAWRECT 0, 0, X, 30, RGB (255,255,0)
USESCREEN -1

CLEARSCREEN RGB(255,0,0)
LOCAL Loop
LOCAL Done = 0
WHILE Done = 0
FOR Loop = 1 TO 100
DRAWSPRITE ScreenImage,Loop,Loop
NEXT

IF KEY(1) THEN Done = 1
SHOWSCREEN
WEND
END


Kitty Hello

You can't make that small textures. Make then at least 8x8, fill the remaining with the transparent colour.

FutureCow

Ahh! At least that problem's solved - thanks Gernot!