RRAvatarRenderable

Objective-C

@interface RRAvatarRenderable : RRRenderable

Swift

class RRAvatarRenderable : RRRenderable

A renderable class used to display avatars.

  • Returns the RRAvatar the renderable is based on.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) RRAvatar *_Nonnull avatar;

    Swift

    var avatar: RRAvatar { get }
  • Gets/sets whether or not the background of the avatar should be rendered. This only gives a visually appealing result if the underlying RRAvatar has alpha matting information (you chan check this with RRAvatar.hasAlphaMatting).

    Declaration

    Objective-C

    @property (nonatomic) BOOL backgroundHidden;

    Swift

    var backgroundHidden: Bool { get set }
  • Returns a new instance of RRAvatarRenderable constructed from a provided RRAvatar. The returned RRAvatarRenderable instance holds the provided RRAvatar instance and uses the avatar’s data for rendering.

    Declaration

    Objective-C

    + (RRAvatarRenderable *_Nonnull)avatarRenderableWithAvatar:
        (RRAvatar *_Nonnull)avatar;

    Swift

    /*not inherited*/ init(avatar: RRAvatar)

    Parameters

    avatar

    The RRAvatar that should be displayed using this renderable.

    Return Value

    New instance on success, nil otherwise.

  • Returns a RRRenderableType instance identifying RRAvatarRenderable 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

    the RRAvatarRenderable type instance

  • Enables/Disables the Upsampling 3D feature for this renderable. Enabling this feature requires that the underlying RRAvatar has valid Upsampling3D data. You can compute this data by calling -[RRAvatar computeUpsampling3DDataForGender:completionCallback:]. Otherwise, enabling this feature has no visual effect.

    Declaration

    Objective-C

    @property (nonatomic) BOOL upsampling3DEnabled;

    Swift

    var upsampling3DEnabled: Bool { get set }
  • Sets the callback that should be called when the tryon ready for rendering.

    Declaration

    Objective-C

    - (void)setTryonReadyCallback:(nullable void (^)(void))callback;

    Swift

    func setTryonReadyCallback(_ callback: (() -> Void)?)

    Parameters

    callback

    The callback that should be called or nil for resetting the callback