TextObjectAttributes
public struct TextObjectAttributes
Overview
Structure for managing basic font rendering attributes for text objects.
Properties
Property | Description |
---|---|
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. |
-
▶︎fontName
Font name.
Declaration
Swift
public var fontName: String
-
▶︎fontSize
Font size.
Declaration
Swift
public var fontSize: CGFloat
-
Font color.
Declaration
Swift
public var fontColor: SKColor
-
Overview
Structure describing text alignment.
Properties
Property Description horizontal Horizontal text alignment. vertical Vertical text alignment. Declaration
Swift
public struct TextAlignment
-
Text alignment.
Declaration
Swift
public var alignment: TextAlignment
-
▶︎wrap
Indicates text is allowed to wrap.
Declaration
Swift
public var wrap: Bool
-
▶︎isBold
Text is bolded.
Declaration
Swift
public var isBold: Bool
-
▶︎isItalic
Text is italicized.
Declaration
Swift
public var isItalic: Bool
-
Text is underlined.
Declaration
Swift
public var isUnderline: Bool
-
Text is displayed with a strikethrough.
Declaration
Swift
public var isStrikeout: Bool
-
Font scaling property.
Declaration
Swift
public var renderQuality: CGFloat
-
Initialize with basic font attributes.
Declaration
Swift
public init(font: String, size: CGFloat, color: SKColor = .black)