RRGarmentRenderable

Objective-C

@interface RRGarmentRenderable : RRRenderable

Swift

class RRGarmentRenderable : RRRenderable

A renderable class used to display a garment fitted to an avatar.

  • Updates the garment’s texture. This method is usually needed when the high resolution texture was downloaded seperately. After updating the texture, the renderable automatically updates its appearance. If a RGB texture is used, the alpha channel is taken from the currently set texture (rescaling is applied if necessary).

    Declaration

    Objective-C

    - (void)setTexture:(RRImage *_Nonnull)garmentImage;

    Swift

    func setTexture(_ garmentImage: RRImage)

    Parameters

    garmentImage

    A texture as RGB or RGBA image.

  • Gets or sets the underlying garment. If the garment is set, changes are detected and the apperance of the renderable is updated accordingly.

    Declaration

    Objective-C

    @property (nonatomic, strong) RRGarment *_Nonnull garment;

    Swift

    var garment: RRGarment { get set }
  • Invokes recomputation of the fit for the associated avatar. If the renderable was created with autocomputeFit = YES you usually don’t have to call this method.

    Declaration

    Objective-C

    - (void)computeFit;

    Swift

    func computeFit()
  • Returns a RRRenderableType instance identifying RRGarmentRenderable instances. This instance can be compared to other RRRenderableType instances using isEqual: returned by the function getType of any AbstractRenderable subclass.

    Declaration

    Objective-C

    + (RRRenderableType *_Nonnull)getRenderableType;

    Swift

    class func getType() -> RRRenderableType

    Return Value

    A RRRenderableType instance representing the type RRGarmentRenderable.

  • Creates a garment renderable from a garment. Auto compute fit is set to true in this case, auto compute height to false.

    Declaration

    Objective-C

    + (RRGarmentRenderable *_Nullable)garmentRenderableWithGarment:
        (RRGarment *_Nonnull)garment;

    Swift

    /*not inherited*/ init?(garment: RRGarment)

    Parameters

    garment

    A RRGarment to create the renderable from.

    Return Value

    Returns an instance of RRGarmentRenderable on success, nil otherwise (This can happen if the provided RRGarment instance is non-tryonable).