AvatarGUIRendererComponent

Renders an avatar-format Entity in the UI.

# Properties

[{"index":"Color Color","0":"Changes the entire avatar color to the specified color value."}]

[{"index":"boolean FlipX","0":"Determines whether to invert based on the X axis."}]

[{"index":"boolean FlipY","0":"Determines whether to invert based on the Y axis."}]

[{"index":"string MaterialId (Sync)","0":"Specifies the Id of the material to be applied to the renderer."}]

[{"index":"float PlayRate","0":"You can specify the playback speed of avatar animations. It supports a value of 0 or more. The higher the number, the faster it is."}]

[{"index":"PreserveSpriteType PreserveAvatar","0":"Defines how the image's proportions, size, and pivot are saved."}]

[{"index":"boolean RaycastTarget","0":"Becomes the subject of screen touch or mouse clicks if the value is set to true. The UI hidden behind the avatar will not receive screen touch and mouse click inputs."}]

##### inherited from Component:

[{"index":"boolean Enable (Sync)","0":"Checks whether Component is activated or not."}]

[{"index":"boolean EnableInHierarchy (ReadOnly) (HideFromInspector)","0":"Displays whether this Component is Enable in the hierarchy. If Entity Enable is false regardless of Component Enable, returns false."}]

[{"index":"Entity Entity (ReadOnly)","0":"The Entity that owns this component."}]

# Methods

[{"index":"void ChangeMaterial(string materialId)","0":"Replaces the material to be applied to the renderer."}]

[{"index":"Entity GetAvatarRootEntity() (ClientOnly)","0":"Gets the AvatarRoot Entity, the top-level Entity composing the avatar."}]

[{"index":"Entity GetBodyEntity() (ClientOnly)","0":"Gets the body Entity composing the avatar."}]

[{"index":"Entity GetFaceEntity() (ClientOnly)","0":"Gets the face Entity composing the avatar."}]

[{"index":"void PlayEmotion(EmotionalType emotionalType, float duration) (ClientOnly)","0":"Play emotion."}]

[{"index":"void SetAvatarPartColor(MapleAvatarItemCategory category, float r, float g, float b, float a) (ClientOnly)","0":"Sets the color values of the parts corresponding to the avatar's category. Uses RGB values."}]

##### inherited from Component:

[{"index":"boolean IsClient()","0":"Returns whether the current execution environment is a client or not."}]

[{"index":"boolean IsServer()","0":"Returns whether the current execution environment is a server or not."}]

# Examples

#### PlayEmotion

Press the F1 through F5 keys to change emotes.
    
    
    @Component
    script PlayerEmotionController extends Component
        @ExecSpace("ClientOnly")
        method void ChangeEmotion(number emotionNumber)
        if emotionNumber == 1 then
            self.Entity.AvatarGUIRendererComponent:PlayEmotion(EmotionalType.Vomit, 5)
        elseif emotionNumber == 2 then
            self.Entity.AvatarGUIRendererComponent:PlayEmotion(EmotionalType.Glitter, 5)
        elseif emotionNumber == 3 then
            self.Entity.AvatarGUIRendererComponent:PlayEmotion(EmotionalType.Hum, 5)
        elseif emotionNumber == 4 then
            self.Entity.AvatarGUIRendererComponent:PlayEmotion(EmotionalType.Love, 5)
        elseif emotionNumber == 5 then
            self.Entity.AvatarGUIRendererComponent:PlayEmotion(EmotionalType.Shine, 5)
        end
        end
    
        @EventSender("Self")
        handler HandleKeyDownEvent(KeyDownEvent event)
        -- Parameters
        local key = event.key
        --------------------------------------------------------
        if key == KeyboardKey.F1 then
        	self:ChangeEmotion(1)
        elseif key == KeyboardKey.F2 then
        	self:ChangeEmotion(2)
        elseif key == KeyboardKey.F3 then
        	self:ChangeEmotion(3)
        elseif key == KeyboardKey.F4 then
        	self:ChangeEmotion(4)
        elseif key == KeyboardKey.F5 then
        	self:ChangeEmotion(5)
        end
        end
    end
    

# SeeAlso

  * KeyboardKey
  * KeyDownEvent
  * InputService
  * [Representing Avatars in the UI](/docs?postId=953)