forked from JohnSundell/SuperSpriteKit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSSKMultiLineLabelNode.h
executable file
·104 lines (85 loc) · 3.86 KB
/
SSKMultiLineLabelNode.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#import <SpriteKit/SpriteKit.h>
#import "SSKMultiplatform.h"
/**
* A label node capable of rendering multiple lines of text
*
* This class depends on the SSKMultiplatform header
*/
@interface SSKMultiLineLabelNode : SKNode
/**
* The name of the font to use when rendering the node's text
*/
@property (nonatomic, copy) NSString *fontName;
/**
* The font size to use when rendering the node's text
*/
@property (nonatomic) CGFloat fontSize;
/**
* The font color to use when rendering the node's text
*/
@property (nonatomic, strong) SKColor *fontColor;
/**
* The text the node is displaying
*
* @discussion Setting this property will cause the node to re-render its text.
*/
@property (nonatomic, copy) NSString *text;
/**
* The total size of the node
*/
@property (nonatomic, readonly) CGSize size;
/**
* Allocate and initialize a new instance of JSMultiLineLabelNode
*
* @param fontName The name of the font to use when rendering the node's text.
* @param fontSize The font size to use when rendering the node's text.
* @param maximumWidth The maximum width the node should have. When a line of
* text has reached the maximum width, the text will be wrapped to a new line.
* @param text The text the node should display.
*/
+ (instancetype)multiLineLabelNodeWithFontNamed:(NSString *)fontName
fontSize:(CGFloat)fontSize
maximumWidth:(CGFloat)maximumWidth
text:(NSString *)text;
/**
* Allocate and initialize a new instance of JSMultiLineLabelNode
*
* @param fontName The name of the font to use when rendering the node's text.
* @param fontSize The font size to use when rendering the node's text.
* @param fontColor The font color to use when rednering the node's text.
* @param numberOfLines The maximum number of lines the node should have.
* When the maximum number of lines has been reached, the node will stop
* rendering text.
* @param maximumWidth The maximum width the node should have. When a line of
* text has reached the maximum width, the text will be wrapped to a new line.
* @param text The text the node should display.
*/
+ (instancetype)multiLineLabelNodeWithFontNamed:(NSString *)fontName
fontSize:(CGFloat)fontSize
fontColor:(SKColor *)fontColor
numberOfLines:(NSUInteger)numberOfLines
maximumWidth:(CGFloat)maximumWidth
text:(NSString *)text;
/**
* Allocate and initialize a new instance of JSMultiLineLabelNode
*
* @param fontName The name of the font to use when rendering the node's text.
* @param fontSize The font size to use when rendering the node's text.
* @param fontColor The font color to use when rednering the node's text.
* @param numberOfLines The maximum number of lines the node should have.
* When the maximum number of lines has been reached, the node will stop
* rendering text.
* @param lineHeightMultiplier Modifies the lineheight by multiplying the current
* font lineheight with this value.
* @param maximumWidth The maximum width the node should have. When a line of
* text has reached the maximum width, the text will be wrapped to a new line.
* @param text The text the node should display.
*/
+ (instancetype)multiLineLabelNodeWithFontNamed:(NSString *)fontName
fontSize:(CGFloat)fontSize
fontColor:(SKColor *)fontColor
numberOfLines:(NSUInteger)numberOfLines
lineHeightMultiplier:(CGFloat)lineHeightMultiplier
maximumWidth:(CGFloat)maximumWidth
text:(NSString *)text;
@end