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

    text

    The 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

    fontName

    The font list.

  • Returns the font size.

    Declaration

    Objective-C

    - (float)getFontSize;

    Swift

    func getFontSize() -> Float

    Return 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

    size

    The font size in density-independent pixels. The default is 14.

  • Returns the text colour. The object’s own colour tints the whole label, plate included.

    Declaration

    Objective-C

    - (MSFColor *)getTextColor;

    Swift

    func getTextColor() -> MSFColor!

    Return Value

    The text colour.

  • Sets the text colour.

    Declaration

    Objective-C

    - (void)setTextColor:(MSFColor *)color;

    Swift

    func setTextColor(_ color: MSFColor!)

    Parameters

    color

    The text colour. The default is black.

  • Returns the halo colour.

    Declaration

    Objective-C

    - (MSFColor *)getHaloColor;

    Swift

    func getHaloColor() -> MSFColor!

    Return Value

    The halo colour.

  • Sets the colour of the outline drawn around the letters.

    Declaration

    Objective-C

    - (void)setHaloColor:(MSFColor *)color;

    Swift

    func setHaloColor(_ color: MSFColor!)

    Parameters

    color

    The halo colour.

  • Returns the halo width.

    Declaration

    Objective-C

    - (float)getHaloWidth;

    Swift

    func getHaloWidth() -> Float

    Return 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

    width

    The halo width in density-independent pixels.

  • Returns the background colour.

    Declaration

    Objective-C

    - (MSFColor *)getBackgroundColor;

    Swift

    func getBackgroundColor() -> MSFColor!

    Return Value

    The background colour.

  • Sets the colour of the plate behind the text. Fully transparent, the default, draws none.

    Declaration

    Objective-C

    - (void)setBackgroundColor:(MSFColor *)color;

    Swift

    func setBackgroundColor(_ color: MSFColor!)

    Parameters

    color

    The background colour.

  • Returns the corner radius of the plate.

    Declaration

    Objective-C

    - (float)getBackgroundRadius;

    Swift

    func getBackgroundRadius() -> Float

    Return 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

    radius

    The 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() -> Float

    Return 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

    padding

    The 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() -> Float

    Return 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

    padding

    The padding in density-independent pixels.

  • Returns the horizontal anchor point.

    Declaration

    Objective-C

    - (float)getAnchorPointX;

    Swift

    func getAnchorPointX() -> Float

    Return 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() -> Float

    Return 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() -> Float

    Return Value

    The offset in density-independent pixels, to the right.

  • Returns the vertical offset.

    Declaration

    Objective-C

    - (float)getOffsetY;

    Swift

    func getOffsetY() -> Float

    Return 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

    x

    The offset in density-independent pixels, to the right.

    y

    The offset in density-independent pixels, up.

  • Returns whether a click on the label hits it.

    Declaration

    Objective-C

    - (BOOL)isClickable;

    Swift

    func isClickable() -> Bool

    Return 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

    clickable

    True if the label is clickable.

  • Undocumented

    Declaration

    Objective-C

    -(void)dealloc;

    Swift

    func dealloc()