; ----------------------------------------------------------------------------------------------------------------------------------- ; This function draws rotated text at the specified location on the screen. ; It works exactly like the text command. ; The text is drawn in the current drawing color. ; ; The only limitation is that black text will not work with this function. ; If you need black text, use Color 1,1,1 instead. ; ; This function disables TFormFilter. You will need to renenable TformFilter after calling this function if you need it enabled. ; ----------------------------------------------------------------------------------------------------------------------------------- Function RotatedText(StringToOutput$, X, Y, Center_X=False, Center_Y=False, Angle) Local OldBuffer Local TempImage ; Store the currently active drawing buffer. OldBuffer = GraphicsBuffer() ; Create an image to hold the text we want to rotate. TempImage = CreateImage(128, 128) ; StringWidth(StringToOutput$), StringHeight(StringToOutput$)) ; Set the drawing buffer to that of the image we want to put the text on. SetBuffer ImageBuffer(TempImage) ; Draw the text to the temporary image. Text 0, 0, Ev$ ; Rotate the image. This changes the size of the image. ; TFormFilter False ; RotateImage TempImage, Angle ; Fix the image mask. ; MaskImage TempImage, 0, 0, 0 ; Draw the rotated image at the specified location on the screen. SetBuffer OldBuffer ; If Center_X Then X = X - ImageWidth(TempImage)/2 ; If Center_Y Then Y = Y - ImageHeight(TempImage)/2 DrawImage TempImage, X, Y ; Clean up. FreeImage TempImage End Function
Does anyone see a bug in the above code?
I set my drawing buffer to an image, I draw two lines of regular white text to confirm that I have set the buffer properly, and then I call this function.
The two lines of regular text appear as expected, but no additional text appears on the screen.
As you can see I've been commenting bits of the function out here and there to try to find the problem, but so far no dice.
Actually now that I think of it... I am writing that OTHER text to an image. It's just that the text I'm wriitng in this function is either not going into the image, or the image it is being drawn to is not being output.