Content

Constructors

NameDescription
fromUri(uri: string):ContentReturns a new Content referencing external content via the given asset URI string. SourceType is set to Uri. If uri is empty, Content.none is returned instead.
fromAssetId(assetId: number):ContentReturns a new Content from a numeric asset ID. Equivalent to calling fromUri("rbxassetid://" .. tostring(assetId)). If assetId is 0, Content.none is returned instead.
fromObject(object: Object):ContentReturns a new Content holding a strong reference to an Object, such as an EditableImage or EditableMesh. SourceType is set to Object. Throws if object is nil.
noneA constant, empty Content value with SourceType of None. Accessed directly as Content.none rather than called as a function.

Code Snippet

local AssetService = game:GetService("AssetService")

local imageLabel = Instance.new("ImageLabel")
imageLabel.ImageContent = Content.fromAssetId(1234567890)

-- Content can also wrap a live Object, like an EditableImage
local editableImage = AssetService:CreateEditableImage()
imageLabel.ImageContent = Content.fromObject(editableImage)

Properties

NameTypeDescription
SourceTypeEnum.ContentSourceTypeIndicates which of the properties below holds a non-nil value.
Uristring?The URI string if SourceType is Uri, otherwise nil.
ObjectObject?A reference to the Object if SourceType is Object, otherwise nil.
OpaqueOpaque?A reference to the Opaque content if SourceType is Opaque, otherwise nil.