DrawRotatedText()

Syntax

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

Parameters

x, y The location of the top/left corner of the text in the output. This is also the location around which the string will be rotated.
Text$ The text to draw.
Angle.f The angle in degrees to rotate counterclockwise starting from the normal text orientation.
Color (optional) The color to be used for the text. If this parameter is not specified, the default color set with FrontColor() will be used. This color can be in RGB or RGBA format. The background of the rotated text is always transparent.

Return value

None.

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

See Also

DrawText(), DrawingFont(), FrontColor()

Supported OS

All

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