MSFCelestialLabel
Objective-C
@interface MSFCelestialLabel : MSFCelestialObject
Swift
class MSFCelestialLabel : MSFCelestialObject
Text in the sky, drawn by the SDK from a string and a style (like the Text vector element). Faces the camera and keeps its pixel size at any field of view. The default anchor point (0, -1) puts the text above the direction it names.
-
Undocumented
Declaration
Objective-C
-(id)init;Swift
init!() -
Returns the text.
Declaration
Objective-C
- (NSString *)getText;Swift
func getText() -> String!Return Value
The text, lines separated by newlines.
-
Sets the text.
Declaration
Objective-C
- (void)setText:(NSString *)text;Swift
func setText(_ text: String!)Parameters
textThe text, lines separated by newlines.
-
Returns the font list.
Declaration
Objective-C
- (NSString *)getFontName;Swift
func getFontName() -> String!Return Value
The font list.
-
Sets the font, as a CSS-like list of names, the preferred first (“Roboto Bold, sans-serif”). A trailing style (“Bold”, “Medium”) picks the weight where the platform names fonts by family.
Declaration
Objective-C
- (void)setFontName:(NSString *)fontName;Swift
func setFontName(_ fontName: String!)Parameters
fontNameThe font list.
-
Returns the font size.
Declaration
Objective-C
- (float)getFontSize;Swift
func getFontSize() -> FloatReturn Value
The font size in density-independent pixels.
-
Sets the font size.
Declaration
Objective-C
- (void)setFontSize:(float)size;Swift
func setFontSize(_ size: Float)Parameters
sizeThe font size in density-independent pixels. The default is 14.
-
Returns the halo width.
Declaration
Objective-C
- (float)getHaloWidth;Swift
func getHaloWidth() -> FloatReturn Value
The halo width in density-independent pixels.
-
Sets the width of the outline drawn around the letters. 0, the default, draws none.
Declaration
Objective-C
- (void)setHaloWidth:(float)width;Swift
func setHaloWidth(_ width: Float)Parameters
widthThe halo width in density-independent pixels.
-
Returns the corner radius of the plate.
Declaration
Objective-C
- (float)getBackgroundRadius;Swift
func getBackgroundRadius() -> FloatReturn Value
The radius in density-independent pixels.
-
Sets the corner radius of the plate.
Declaration
Objective-C
- (void)setBackgroundRadius:(float)radius;Swift
func setBackgroundRadius(_ radius: Float)Parameters
radiusThe radius in density-independent pixels.
-
Returns the horizontal padding between the text and the plate’s edge.
Declaration
Objective-C
- (float)getPaddingX;Swift
func getPaddingX() -> FloatReturn Value
The padding in density-independent pixels.
-
Sets the horizontal padding between the text and the plate’s edge.
Declaration
Objective-C
- (void)setPaddingX:(float)padding;Swift
func setPaddingX(_ padding: Float)Parameters
paddingThe padding in density-independent pixels.
-
Returns the vertical padding between the text and the plate’s edge.
Declaration
Objective-C
- (float)getPaddingY;Swift
func getPaddingY() -> FloatReturn Value
The padding in density-independent pixels.
-
Sets the vertical padding between the text and the plate’s edge.
Declaration
Objective-C
- (void)setPaddingY:(float)padding;Swift
func setPaddingY(_ padding: Float)Parameters
paddingThe padding in density-independent pixels.
-
Returns the horizontal anchor point.
Declaration
Objective-C
- (float)getAnchorPointX;Swift
func getAnchorPointX() -> FloatReturn Value
The anchor point, -1 the left edge, 1 the right edge.
-
Returns the vertical anchor point.
Declaration
Objective-C
- (float)getAnchorPointY;Swift
func getAnchorPointY() -> FloatReturn Value
The anchor point, -1 the bottom edge, 1 the top edge.
-
Sets which point of the label sits on its direction, each coordinate from -1 to 1.
Declaration
Objective-C
- (void)setAnchorPoint:(float)x y:(float)y;Swift
func setAnchorPoint(_ x: Float, y: Float)Parameters
x-1 the left edge, 0 the middle, 1 the right edge.
y-1 the bottom edge, 0 the middle, 1 the top edge.
-
Returns the horizontal offset.
Declaration
Objective-C
- (float)getOffsetX;Swift
func getOffsetX() -> FloatReturn Value
The offset in density-independent pixels, to the right.
-
Returns the vertical offset.
Declaration
Objective-C
- (float)getOffsetY;Swift
func getOffsetY() -> FloatReturn Value
The offset in density-independent pixels, up.
-
Moves the label on screen from its anchor.
Declaration
Objective-C
- (void)setOffset:(float)x y:(float)y;Swift
func setOffset(_ x: Float, y: Float)Parameters
xThe offset in density-independent pixels, to the right.
yThe offset in density-independent pixels, up.
-
Returns whether a click on the label hits it.
Declaration
Objective-C
- (BOOL)isClickable;Swift
func isClickable() -> BoolReturn Value
True if the label is clickable.
-
Sets whether a click on the label hits it. The default is true.
Declaration
Objective-C
- (void)setClickable:(BOOL)clickable;Swift
func setClickable(_ clickable: Bool)Parameters
clickableTrue if the label is clickable.
-
Undocumented
Declaration
Objective-C
-(void)dealloc;Swift
func dealloc()