GetUserThumbnailAsync
This is a yielding function. When called, it will pause the Lua thread that called the function until a result is ready to be returned, without interrupting other scripts.
For thread safety, this property is not safe to read in an unsynchronized thread.
This function fetches a Articles/Content|content URL
of an image of a player’s avatar given their Player/UserId|UserId
, the image size (as an enum) and type (also an enum: avatar, bust, headshot). It also returns a bool describing if the image is ready to be used.
Most often, this method is used with ImageLabel/Image
to display player pictures next to their username in-game. It is also appropriate for Decal/Texture
as well.
Available Sizes
Enum.ThumbnailSize
: Size48x48
, Size60x60
, Size100x100
, Size150x150
, Size180x180
, Size353x353
, Size420x420
Types of User Thumbnails
Enum.ThumbnailType | Description | Example (60px) |
---|---|---|
AvatarBust | Upper chest and head | |
AvatarThumbnail | Entire avatar | |
HeadShot | Just the head and face |
Parameters
Name | Type | Default | Description |
---|---|---|---|
|
The |
||
|
A |
||
|
A |
Returns
Return Type | Summary |
---|---|
A tuple containing the content URL of a user thumbnail based on the specified parameters, and a bool describing if the image is ready to be used or not |
Code Samples
Display Player Thumbnail
This code sample displays the current player’s thumbnail in a parent ImageLabel
by using Players/GetUserThumbnailAsync
and setting the ImageLabel/Image|Image
property as well as its GuiObject/Size|Size
.