M2Rect

sealed class M2Rect : M2Shape

Abstract base class for rectangular drawables rendered on the Maverick 2 glasses display.

Provides corner-radius support and a billboard mode that places the rectangle at a 3-D world position. Concrete subclasses decide whether the rectangle is filled (M2RectFilled) or outlined (M2RectOutline).

Inheritors

Constructors

Link copied to clipboard
protected constructor(tag: Any? = null)
protected constructor(color: M2Color, tag: Any? = null)
protected constructor(color: <Error class: unknown class>, tag: Any? = null)

Functions

Link copied to clipboard
fun M2Rect.animateHeightBy(durationMillis: Long, dHeight: Float, repeat: M2AnimatorRepeat = M2AnimatorRepeat.None, apply: Boolean = false, callback: IM2AnimatorCallback? = null): M2Animator

Animates this rectangle's height by a relative delta dHeight over the given duration.

Link copied to clipboard
fun M2Rect.animateHeightByPercent(durationMillis: Long, percent: Float, repeat: M2AnimatorRepeat = M2AnimatorRepeat.None, apply: Boolean = false, callback: IM2AnimatorCallback? = null): M2Animator

Animates this rectangle's height by a percentage of its current height.

Link copied to clipboard
fun M2Rect.animateWidthBy(durationMillis: Long, dWidth: Float, repeat: M2AnimatorRepeat = M2AnimatorRepeat.None, apply: Boolean = true, callback: IM2AnimatorCallback? = null): M2Animator

Animates this rectangle's width by a relative delta dWidth over the given duration.

Link copied to clipboard
fun M2Rect.animateWidthByPercent(durationMillis: Long, percent: Float, repeat: M2AnimatorRepeat = M2AnimatorRepeat.None, apply: Boolean = true, callback: IM2AnimatorCallback? = null): M2Animator

Animates this rectangle's width by a percentage of its current width.

Link copied to clipboard
protected open override fun copyPropertiesTo(target: M2Drawable, recursive: Boolean)

Convenience overload used by tree implementations that support recursive cloning (e.g., M2Group). The default implementation delegates to copyPropertiesTo without using the recursive flag.

Link copied to clipboard
fun setCornerRadius(roundedCornersSizePix: Float = 1.0f, roundedCornersType: M2RoundedCorners = M2RoundedCorners.All): M2Rect

Configures the corner radius for this rectangle.

Link copied to clipboard
override fun setFill(gradientFill: M2GradientLinear): M2Shape

Sets the fill to a two-color gradient.