DrawRotatedText()

Syntax

DrawRotatedText(x, y, Text$, Angle.f [, Color])
Description
Displays the given string on the current output at the given angle.

Parameters

The x and y parameter refer to the top/left corner of the string to display. This is also the point around which the rotation will take place. The Angle.f parameter specifies the angle in degrees to rotate counter-clockwise starting from the normal text orientation. The 'Color' parameter and can be used to override the color set with FrontColor(). The background of the rotated text is always transparent.

Example:

  If OpenWindow(0, 0, 0, 200, 200, "2DDrawing Example", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
    If CreateImage(0, 200, 200) And StartDrawing(ImageOutput(0))
      Box(0, 0, 200, 200, RGB(255, 255, 255))
      For Angle = 0 To 360 Step 45
        DrawRotatedText(100, 100, "Hello World!", Angle, RGB(0, 0, 0))
      Next Angle
      StopDrawing() 
      ImageGadget(0, 0, 0, 200, 200, ImageID(0))
    EndIf
    
    Repeat
      Event = WaitWindowEvent()
    Until Event = #PB_Event_CloseWindow
  EndIf

Supported OS

All

<- DrawImage() - 2DDrawing Index - DrawText() ->