Posted: 19th Feb 2022 13:37
I am creating a retro style game (resolution of 320x240). I have set it up for pixel perfect rendering where I turned off AA, turned of image mag/min filtering (set to zero), turned off the font image filtering as well, etc. I am rendering to
a fullscreen quad which has a shader applied so I can have a CRT screen effect. The example screenshot has the CRT shader turned off so you can see the problem better. I am also including my graphics init code and my text creation
code. The result is text that does not look correct. Parts of each letter are missing or some parts are thicker. How do I draw pixel art style text? I included an attached screenshot of the problem. I could just put my text on a image that I load but I need to be able to dynamically change the text... I have verified that my bitmap font is not blurry.

Code to setup my graphics:
+ Code Snippet
SetWindowTitle("Star Starfer")
SetWindowSize(WINDOW_WIDTH, WINDOW_HEIGHT, Settings.Fullscreen)
SetWindowAllowResize(TRUE)
SetResolutionMode(TRUE)
SetVirtualResolution(TARGET_WIDTH, TARGET_HEIGHT)
SetOrientationAllowed(FALSE, FALSE, TRUE, TRUE)
SetSyncRate(60, FALSE)
SetDefaultMagFilter(0)
SetDefaultMinFilter(0)
SetTextDefaultMagFilter(0)
SetTextDefaultMinFilter(0)
SetAntialiasMode(FALSE)

if Settings.UseCRTEffect
	CRTShader = LoadFullScreenShader("CRTShader.ps")
endif
	
TargetBuffer = CreateRenderImage(TARGET_WIDTH, TARGET_HEIGHT, 0, 0)
TargetQuad = CreateObjectQuad()
SetObjectImage(TargetQuad, TargetBuffer, 0)

if Settings.UseCRTEffect
	SetObjectShader(TargetQuad, CRTShader)
endif


Code where I create the text:
+ Code Snippet
Button.Text = CreateText(Text)
SetTextColor(Button.Text, 247, 247, 247, 255)
SetTextDepth(Button.Text, DEPTH_GUI_TEXT)
SetTextSize(Button.Text, 12)
	
SetSpritePosition(Button.Sprite, X - 32, Y - 8)
SetTextPosition(Button.Text, X - (GetTextTotalWidth(Button.Text) / 2), Y - (GetTextTotalHeight(Button.Text) / 2))
	
FixTextToScreen(Button.Text, TRUE)
FixSpriteToScreen(Button.Sprite, TRUE)
Posted: 19th Feb 2022 15:38
Forgot to mention, the text in question is in the bottom right where the button is. The title is a sprite
Posted: 19th Feb 2022 16:22
bottom right

that's bottom left in my neck of the woods

meanwhile, probably not the issue but it reminded me of this SetDefaultWrapU/V issue in HTML.

ie, try setting the image Min/Mag filters manually and individually via SetImageMin/MagFilter() vs relying on Default?

it's worth a shot.
Posted: 19th Feb 2022 20:53
"

No luck. Thanks for the advice.

EDIT: forgot to mention that the way the text looks changes when I resize the window. The button sprite does this as well.