However, I never did get around to working out a proper solution for aligning bitmap font based text, so I figured I would go ahead and see if anyone here had any suggestions.
To compensate for this, I simply used spaces in my original patcher. Not very pretty, but it's one of the first things I ever made with PureBasic and I wanted to finish it quickly.
This piece of code was for optimization to avoid having to draw each character individually; on startup, this sprite is created so that only a single sprite needs to be drawn to the screen later.
Code: Select all
Procedure CreateHeader()
Protected Header.s, Character.s, X.i = 11, OriginalX.i = X, Y.i = 16, OriginalY.i = Y
Header = " asio link pro patcher #"
Header + "<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~> #"
Header + " brought to you by g.a. collective 2018#"
Header + "<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>"
CreateSprite(#SpriteHeader, #ScreenWidth, #ScreenHeight)
ClearScreen(FastRGB(255, 0, 255))
For i = 1 To Len(Header)
Character = LCase(Mid(Header, i, 1))
If FindMapElement(Font(), Character)
ClipSprite(#SpriteFont, Font(Character)\X, Font(Character)\Y, Font(Character)\W, Font(Character)\H)
ZoomSprite(#SpriteFont, SpriteWidth(#SpriteFont) * 2, SpriteHeight(#SpriteFont) * 2)
DisplayTransparentSprite(#SpriteFont, X, Y)
X + ((Font(Character)\W * 2) - 2)
Else
If Character = "#"
Y + 22
X = OriginalX
Else
X + 8
EndIf
EndIf
Next
GrabSprite(#SpriteHeader, 0, 0, #ScreenWidth, #ScreenHeight, #PB_Sprite_AlphaBlending)
TransparentSpriteColor(#SpriteHeader, FastRGB(255, 0, 255))
ClearScreen(FastRGB(28, 28, 28))
EndProcedureFor anyone that might be curious, this is the old patcher I made in use.
Thanks!




