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:
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:
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)