Hi Creators ![]()
![]()
We’re excited to announce some updates to our In-Game Asset Creation system!
What’s Changing?
-
API Method Rename: We have renamed the previous prompt publish asset method to AssetService:PromptCreatePlatformContentAsync, and updated it to take in an Object instead of an Instance. This update sets a cleaner standard for how in-game creation and publishing prompts will function moving forward.
-
Image Publishing Is Live! As of today, uploading an EditableImage directly through
PromptCreatePlatformContentAsyncis fully released and live! Published images go straight to the player’s inventory, allowing them to use their creations across other Roblox experiences or even off-platform.
Here’s a code snippet to try it out. This one draws the Roblox logo directly from a ServerScript and prompts the player to upload it.
Click to see the code snippet:
local AssetService = game:GetService("AssetService")
local Players = game:GetService("Players")
local BLUE = {49, 86, 255}
local WHITE = {255, 255, 255}
local SIZE = 400
local CENTER = SIZE / 2
local OUTER_HALF = 100
local INNER_HALF = 28
local ANGLE = math.rad(15)
local COS = math.cos(ANGLE)
local SIN = math.sin(ANGLE)
local SAMPLES = 4
local function isInsideSquare(x, y, halfSize)
return math.abs(x) <= halfSize
and math.abs(y) <= halfSize
end
local function generateLogo()
local editableImage = AssetService:CreateEditableImage({
Size = Vector2.new(SIZE, SIZE),
})
if not editableImage then
warn("Could not create EditableImage. Make sure access to the Editable Mesh / Image apis is enabled.")
return nil
end
local pixels = buffer.create(SIZE * SIZE * 4)
for py = 0, SIZE - 1 do
for px = 0, SIZE - 1 do
local whiteSamples = 0
-- Test subpixel positions to antialias the edges.
for sy = 0, SAMPLES - 1 do
for sx = 0, SAMPLES - 1 do
local screenX = px + (sx + 0.5) / SAMPLES - CENTER
local screenY = py + (sy + 0.5) / SAMPLES - CENTER
-- Undo the square's clockwise rotation.
local x = screenX * COS + screenY * SIN
local y = -screenX * SIN + screenY * COS
local outer = isInsideSquare(x, y, OUTER_HALF)
local inner = isInsideSquare(x, y, INNER_HALF)
if outer and not inner then
whiteSamples += 1
end
end
end
local coverage = whiteSamples / (SAMPLES * SAMPLES)
local offset = (py * SIZE + px) * 4
for channel = 1, 3 do
local background = BLUE[channel]
local foreground = WHITE[channel]
local value = background
+ (foreground - background) * coverage
buffer.writeu8(pixels, offset + channel - 1,
math.floor(value + 0.5))
end
buffer.writeu8(pixels, offset + 3, 255)
end
end
editableImage:WritePixelsBuffer(
Vector2.zero,
Vector2.new(SIZE, SIZE),
pixels
)
return editableImage
end
Players.PlayerAdded:Connect(function(player)
-- CoreGui needs to be loaded for the Prompt method to work.
player.CharacterAdded:Wait()
local logo = generateLogo()
local success, result, assetId = pcall(function()
return AssetService:PromptCreatePlatformContentAsync(player, logo, Enum.AssetType.Image)
end)
if success then
print("Published successfully! Result:", result, "AssetId:", assetId)
else
warn("Failed to publish image:", result)
end
end)
Note: If you’re testing this out in Studio, make sure you’re testing in a published place - it will fail otherwise. Your game must also have the “Allow Mesh / Image APIs” setting enabled.
Here’s one thats a bit more interactive! It requires a bit of setup
-
Create a RemoteEvent called
PublishDrawinginReplicatedStorage -
Add the following LocalScript to
StarterPlayerScripts. It handles user interaction and on publish, writes the EditableImage to a buffer and sends it over theRemoteEventto be handled by the server.
Click to see the code snippet:
-- LocalScript in StarterPlayer > StarterPlayerScripts
local Players = game:GetService("Players")
local AssetService = game:GetService("AssetService")
local UserInputService = game:GetService("UserInputService")
local player = Players.LocalPlayer
-- Configuration
local CANVAS_SIZE = 256
local BRUSH_RADIUS = 5
local BACKGROUND = Color3.fromRGB(255, 255, 255)
local COLORS = {
Color3.fromRGB(25, 25, 35),
Color3.fromRGB(255, 70, 70),
Color3.fromRGB(255, 170, 40),
Color3.fromRGB(255, 220, 60),
Color3.fromRGB(70, 200, 110),
Color3.fromRGB(50, 130, 255),
Color3.fromRGB(160, 90, 255),
Color3.fromRGB(255, 110, 200),
Color3.fromRGB(255, 255, 255),
}
-- Helpers
local function make(className, props, parent)
local object = Instance.new(className)
for key, value in pairs(props) do
object[key] = value
end
object.Parent = parent
return object
end
local function round(gui, radius)
make("UICorner", {
CornerRadius = UDim.new(0, radius),
}, gui)
end
-- UI
local gui = make("ScreenGui", {
Name = "PixelArtStudio",
ResetOnSpawn = false,
}, player:WaitForChild("PlayerGui"))
local panel = make("Frame", {
Name = "Panel",
Size = UDim2.fromOffset(440, 520),
Position = UDim2.new(0.5, -220, 0.5, -260),
BackgroundColor3 = Color3.fromRGB(29, 31, 42),
BorderSizePixel = 0,
}, gui)
round(panel, 14)
make("TextLabel", {
Size = UDim2.new(1, -32, 0, 42),
Position = UDim2.fromOffset(16, 8),
BackgroundTransparency = 1,
Text = "Draw Something!",
TextColor3 = Color3.new(1, 1, 1),
Font = Enum.Font.GothamBold,
TextSize = 22,
TextXAlignment = Enum.TextXAlignment.Left,
}, panel)
-- Editable canvas
local editableImage = AssetService:CreateEditableImage({
Size = Vector2.new(CANVAS_SIZE, CANVAS_SIZE),
})
if not editableImage then
warn("Could not create EditableImage. Check Mesh / Image API permissions.")
gui:Destroy()
return
end
editableImage:DrawRectangle(
Vector2.zero,
Vector2.new(CANVAS_SIZE, CANVAS_SIZE),
BACKGROUND,
0,
Enum.ImageCombineType.Overwrite
)
local canvas = make("ImageLabel", {
Name = "Canvas",
Size = UDim2.fromOffset(320, 320),
Position = UDim2.fromOffset(60, 78),
BackgroundColor3 = BACKGROUND,
BorderSizePixel = 0,
ImageContent = Content.fromObject(editableImage),
ScaleType = Enum.ScaleType.Fit,
Active = true,
}, panel)
make("UIStroke", {
Color = Color3.fromRGB(80, 85, 105),
Thickness = 2,
}, canvas)
-- Palette
local palette = make("Frame", {
Size = UDim2.new(1, -32, 0, 36),
Position = UDim2.fromOffset(16, 412),
BackgroundTransparency = 1,
}, panel)
make("UIListLayout", {
FillDirection = Enum.FillDirection.Horizontal,
HorizontalAlignment = Enum.HorizontalAlignment.Center,
VerticalAlignment = Enum.VerticalAlignment.Center,
Padding = UDim.new(0, 7),
}, palette)
local selectedColor = COLORS[1]
local erasing = false
local function selectColor(color)
selectedColor = color
erasing = color == BACKGROUND
end
for _, color in ipairs(COLORS) do
local swatch = make("TextButton", {
Size = UDim2.fromOffset(28, 28),
BackgroundColor3 = color,
BorderSizePixel = 0,
Text = "",
AutoButtonColor = true,
}, palette)
round(swatch, 7)
if color == COLORS[1] then
make("UIStroke", {
Color = Color3.new(1, 1, 1),
Thickness = 2,
}, swatch)
end
swatch.Activated:Connect(function()
selectColor(color)
end)
end
-- Controls
local controls = make("Frame", {
Size = UDim2.new(1, -32, 0, 40),
Position = UDim2.fromOffset(16, 456),
BackgroundTransparency = 1,
}, panel)
make("UIListLayout", {
FillDirection = Enum.FillDirection.Horizontal,
HorizontalAlignment = Enum.HorizontalAlignment.Center,
Padding = UDim.new(0, 8),
}, controls)
local function makeButton(text, color, callback)
local button = make("TextButton", {
Size = UDim2.fromOffset(120, 36),
BackgroundColor3 = color,
BorderSizePixel = 0,
Text = text,
TextColor3 = Color3.new(1, 1, 1),
TextSize = 13,
Font = Enum.Font.GothamBold,
AutoButtonColor = true,
}, controls)
round(button, 8)
button.Activated:Connect(callback)
return button
end
local status = make("TextLabel", {
Size = UDim2.new(1, -32, 0, 18),
Position = UDim2.fromOffset(16, 498),
BackgroundTransparency = 1,
Text = "Ready to draw!",
TextColor3 = Color3.fromRGB(165, 200, 180),
Font = Enum.Font.Gotham,
TextSize = 11,
TextXAlignment = Enum.TextXAlignment.Left,
}, panel)
makeButton("Clear", Color3.fromRGB(75, 80, 100), function()
editableImage:DrawRectangle(
Vector2.zero,
Vector2.new(CANVAS_SIZE, CANVAS_SIZE),
BACKGROUND,
0,
Enum.ImageCombineType.Overwrite
)
status.Text = "Canvas cleared!"
end)
makeButton("Eraser", Color3.fromRGB(95, 80, 130), function()
erasing = true
selectedColor = BACKGROUND
status.Text = "Eraser selected"
end)
makeButton("Publish", Color3.fromRGB(45, 125, 235), function()
status.Text = "Sending drawing..."
local pixels = editableImage:ReadPixelsBuffer(
Vector2.zero,
Vector2.new(256, 256)
)
game:GetService("ReplicatedStorage")
:WaitForChild("PublishDrawing")
:FireServer(pixels)
status.Text = "Drawing sent to server."
end)
-- Drawing input
local drawing = false
local lastPosition = nil
local function getCanvasPosition(screenPosition)
local origin = canvas.AbsolutePosition
local size = canvas.AbsoluteSize
local x = screenPosition.X - origin.X
local y = screenPosition.Y - origin.Y
if x < 0 or y < 0 or x >= size.X or y >= size.Y then
return nil
end
return Vector2.new(
x * CANVAS_SIZE / size.X,
y * CANVAS_SIZE / size.Y
)
end
local function draw(screenPosition)
local position = getCanvasPosition(screenPosition)
if not position then
lastPosition = nil
return
end
local color = erasing and BACKGROUND or selectedColor
if lastPosition then
editableImage:DrawLine(
lastPosition,
position,
color,
0,
Enum.ImageCombineType.Overwrite,
Enum.AntiAliasing.Disabled
)
end
editableImage:DrawCircle(
position,
BRUSH_RADIUS,
color,
0,
Enum.ImageCombineType.Overwrite,
Enum.AntiAliasing.Disabled
)
lastPosition = position
end
canvas.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1
or input.UserInputType == Enum.UserInputType.Touch then
drawing = true
lastPosition = nil
draw(input.Position)
end
end)
canvas.InputEnded:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1
or input.UserInputType == Enum.UserInputType.Touch then
drawing = false
lastPosition = nil
end
end)
UserInputService.InputChanged:Connect(function(input)
if not drawing then
return
end
if input.UserInputType == Enum.UserInputType.MouseMovement
or input.UserInputType == Enum.UserInputType.Touch then
draw(input.Position)
end
end)
UserInputService.InputEnded:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1
or input.UserInputType == Enum.UserInputType.Touch then
drawing = false
lastPosition = nil
end
end)
- Add the following Script to
ServerScriptService(this callsPromptCreatePlatformContentAsyncwhen thePublishDrawingis fired, since it can only be invoked from the server). It recreates theEditableImageon the server from the buffer sent over by theLocalScript.
Click to see the code snippet:
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local AssetService = game:GetService("AssetService")
local publishEvent = ReplicatedStorage:WaitForChild("PublishDrawing")
local IMAGE_SIZE = 256
local MAX_BYTES = IMAGE_SIZE * IMAGE_SIZE * 4
publishEvent.OnServerEvent:Connect(function(player, pixelBuffer)
if typeof(pixelBuffer) ~= "buffer" then
return
end
if buffer.len(pixelBuffer) ~= MAX_BYTES then
warn("Invalid drawing buffer from", player.Name)
return
end
local editableImage = AssetService:CreateEditableImage({
Size = Vector2.new(IMAGE_SIZE, IMAGE_SIZE),
})
if not editableImage then
warn("Unable to create EditableImage")
return
end
local success, err = pcall(function()
editableImage:WritePixelsBuffer(
Vector2.zero,
Vector2.new(IMAGE_SIZE, IMAGE_SIZE),
pixelBuffer
)
end)
if not success then
warn("Failed to reconstruct drawing:", err)
editableImage:Destroy()
return
end
local ok, result, assetId = pcall(function()
return AssetService:PromptCreatePlatformContentAsync(
player,
editableImage,
Enum.AssetType.Image
)
end)
if not ok then
warn("Publishing prompt failed:", result)
elseif result then
print("Publish result:", result, assetId)
end
editableImage:Destroy()
end)
Safety, Moderation and Ownership
- Persisted content might be moderated after the fact so you should not assume that the AssetID you get back will always work
- Players fully own that content from now on and they can do whatever they see fit with it (export it, build another game etc.)
- Images uploaded via this API have their privacy set to Open Use. Read more about asset privacy here: Asset privacy | Documentation - Roblox Creator Hub
We can’t wait to see the creative tools, drawing canvases, and customized content you build for your players. As always, let us know if you have any questions or feedback. Thank you! ![]()
![]()
FAQs
What happened to the old prompt publish asset methods?
- They have been deprecated and renamed to
PromptCreatePlatformContentAsyncto better align with platform standards as we expand creation capabilities. The method also takes in anObject, which allows us to take in anEditableImagedirectly instead of an instance.
Which asset types are supported right now?
- Currently, support is enabled for EditableImages.
What asset type is coming next?
- What asset type should come next? Audio? Meshes?


