Platforms to show: All Mac Windows Linux Cross-Platform
Back to Graphics class.
Graphics.DrawRotatedTextMBS(Rotation as Double, text as string, x as Integer, y as Integer, Center as Boolean = false, alpha as Double = 1.0, NoSwapY as boolean = false, FontWidth as Integer = 0)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Graphics & Pictures | MBS Util Plugin | 11.2 | ✅ Yes | ✅ Yes | ❌ No | ❌ No | Desktop only |
Rotation is the angle in degree.
Currently only supported for Mac OS X and Windows in GUI applications.
The plugin does not see the clipping offset for the graphics object. So for graphics objects from printer or canvas, you need to offset the position. Seems like with a Canvas the coordinates are relative to canvas in Cocoa, but relative to Windows in Carbon.
We have the optional parameter Center which tells the plugin to center the rotated text, so the rotation point is in the middle of the text.
The plugin queries Bold, Italic, Underline, ForeColor, TextUnit, TextSize or TextFont.
Alpha gives the alpha value for Mac OS X. Can be 1.0 (Full color) to 0.0 (no color).
On Mac targets the Y coordinate needs to be swapped internally from top down coordinates to bottom up coordinates. As this does not work 100% correct on printers (the plugin doesn't know page margins), you can provide correct Y coordinate yourself and pass NoSwapY = true. (added in plugin version 13.1)
On Windows the OS function used (ExtTextOut) does not support multiple lines.
FontWidth is only for Windows to define the width of the font. Default is 0 to use default width.
The average width, in logical units, of characters in the font. If FontWidth is zero, the aspect ratio of the device is matched against the digitization aspect ratio of the available fonts to find the
On Windows for drawing in a picture, make sure the font size and font name are set. Else it may not draw.
For Windows, we only use HDC for drawing, so if you have a graphics context not using a HDC, this function doesn't draw. The function is not updated for DirectDraw.
Some examples using this method:
Blog Entries
- MBS Xojo Plugins, version 21.2pr1
- MBS Xojo Plugins, version 18.2pr1
- MonkeyBread Software Releases the MBS Xojo plug-ins in version 17.0
- MBS Xojo / Real Studio Plugins, version 17.0pr4
- MBS Real Studio Plugins, version 13.1pr1
- MBS Real Studio Plugins, version 11.4pr2
- MBS Real Studio Plugins, version 11.3fc
- MBS Real Studio Plugins, version 11.3pr8
- Rotated text
- MBS REALbasic Plugins, version 11.2pr1
Xojo Developer Magazine
- 17.5, page 42: What's New in the MBS Plugins, With the Plugins growing every year, here are new capabilities you may have missed by Stefanie Juchmes
- 15.2, page 10: News
- 10.1, page 75: Using Plugins, Working with the Monkeybread Plugins by Marc Zeedar
Videos
The items on this page are in the following plugins: MBS Util Plugin.