TextObjectAttributes
public struct TextObjectAttributes
The TextObjectAttributes
structure is used for managing basic font rendering attributes for text objects.
Properties
fontName
: font name.fontSize
: font size.fontColor
: font color.alignment
: horizontal/vertical text alignment.wrap
: text wraps.isBold
: text is bold.isItalic
: text is italicized.isUnderline
: text is underlined.renderQuality
: font scaling attribute.
-
Font name.
Declaration
Swift
public var fontName: String
-
Font size.
Declaration
Swift
public var fontSize: CGFloat
-
Font color.
Declaration
Swift
public var fontColor: SKColor
-
Structure describing text alignment.
Properties
horizontal
: Horizontal text alignment.vertical
: Vertical text alignment.
Declaration
Swift
public struct TextAlignment
-
Text alignment.
Declaration
Swift
public var alignment: TextAlignment
-
Text is wrapped.
Declaration
Swift
public var wrap: Bool
-
Text is bolded.
Declaration
Swift
public var isBold: Bool
-
Text is italicized.
Declaration
Swift
public var isItalic: Bool
-
Text is underlined.
Declaration
Swift
public var isUnderline: Bool
-
Text is has a strike through it.
Declaration
Swift
public var isStrikeout: Bool
-
Font scaling property. Increase this value to increase text clarity at higher resolutions.
Declaration
Swift
public var renderQuality: CGFloat
-
Default initializer.
Declaration
Swift
public init()
-
Initialize with basic font attributes.
Declaration
Swift
public init(font: String, size: CGFloat, color: SKColor = .black)
Parameters
font
font name.
size
font size.
color
font color.
-
Returns a font for the text object attributes, if available (iOS & tvOS).
-
Returns a font for the text object attributes, if available (macOS).
Declaration
Swift
public var font: NSFont { get }