Quote: "Just struggling with the font issue. Im sure its to do with pixel width for arial characters. "
If you're having that much trouble with the fonts you could always turn them into sprites by rendering your text to a separate bitmap and then spriting them to the screen (put texture smoothing ON when getting the image that you plan to scale very large, otherwise turn it off for a finer image with smaller fonts). It uses more resources but it might be easier (You'll also have more flexibility over appearance). NOTE: This can be done with a 3D plain too.
remstart
Simple (supposed to be) example of using bitmaps to store and paste text as sprites.
I was lazy so I ended up pasting some functions from another program into this. Just ignore the functions() comments.
BTW, you can use a 3D plain to do this too using texturing!
remend
`Gets the highest 16x9 res possible.
GetOptimalDisplayMode()
`Make a colourful mess for a background
For i = 1 to 1000
INK RGB(rnd(255),rnd(255),rnd(255)), RGB(0,0,0)
bx = RND(screen width()): by = RND(screen height())
BOX bx, by, bx + 50, by + 50
Next i
`A texture flag of 1 will maintain pixel-perfect sharpness. Better for finer things but not good for resizing.
Get Image 1, 0, 0, Screen width(), Screen Height(), 1
`Put our 3D backdrop on and make it black because that blue bg gives me bsod memories.
Color Backdrop RGB(0,0,0)
`Sprite our mess
Sprite 1, 0, 0, 1
`Darken the background so our fonts show
Set Sprite Diffuse 1, 180, 180, 180
`Now write to the screen, the long way. Can be any size (the smaller the better for memory).
Create Bitmap 1, screen width(), screen height()
`Set drawing operations to this bitmap
Set Current Bitmap 1
`Set a bright colour for fonts
INK RGB(255,255,255), RGB(255,255,255)
`Print some stuff to the bitmap
Set Text Font "Arial"
Set Text Size 22
Set Text To Bold
Print "Hello Venus!"
Print "------------"
Print "A: Say, would you like to go and see a movie?"
Print "B: I'm feeling fat and sassy."
Print "A: DOYOOOOOOO!"
Print "B: DOYOOOOOOO!"
Print "Press up to INC font opacity and down to DEC it"
Print "Press w to INC font size, press s to DEC it"
`Try changing the 1 on the end to a zero when scaling up and see what happens.
Get Image 2, 0, 0, screen width(), screen height(), 1
` Set drawing back to screen and cull unnecessary bitmap
Set Current Bitmap 0: Delete Bitmap 1
Sprite 2, 0, 0, 2
Scale = 100
Opacity = 200
DO
If Scancode() > 0
Scale Sprite 2, Scale
Set Sprite Alpha 2, Opacity
EndIf
If Upkey() = 1: INC Opacity, 1: EndIf
If Downkey() = 1: INC Opacity, -1: EndIf
If Inkey$() = "w": INC Scale, 1: EndIf
If Inkey$() = "s": INC Scale, -1: EndIf
If Scale < 1: Scale = 1: EndIf
If Opacity > 255: Opacity = 255: EndIf
If Opacity < 1: Opacity = 1: EndIf
LOOP
FUNCTION GetOptimalDisplayMode()
`Finds the optimal display mode in order of criteria: 32-bit colour depth, 1.77 AR, highest resolution
`First get the default screen resolution/depth (whatever I decide to make it when I'm finished this project)
DIM Optimal(3): Optimal(1) = screen width(): Optimal(2) = screen height(): Optimal(3) = screen depth()
`Check available screen modes
PERFORM CHECKLIST FOR DISPLAY MODES
FOR i = 1 to checklist quantity()
`Only bother to check 32-bit colour depth modes (saves time)
IF checklist value c(i) = 32
`For some reason I have to assign checklist values to floats before performing my calculations. a# = b / c gives me an int.
cva# = checklist value a(i): cvb# = checklist value b(i)
`If the AR is around 1.7 (16x9) then check to see if this mode is higher res than the current one. If so, change.
IF between(cva# / cvb#, 1.6999, 1.7999) = 1
IF checklist value a(i) > Optimal(1): Optimal(1) = checklist value a(i): Optimal(2) = checklist value b(i): Optimal(3) = checklist value C(i): ENDIF
ENDIF
ENDIF
NEXT i
`Set the display mode
IF Optimal(1) > screen width(): SET DISPLAY MODE Optimal(1), Optimal(2), Optimal(3): ENDIF
`Free memory, kill the array.
UNDIM Optimal(0)
EndFunction
Function Between(Num#, Low#, High#)
`This is a function I use in most of my programs. It saves typing in the long run. Fairly straightforward.
RetVal = 0
If Num# > Low# and Num# < High# then RetVal = 1
EndFunction RetVal