Blog / Luau Architecture 4 min read

Native Roblox Frame + UICorner vs uploaded UI art: when your AI should use each

Comparing zero-upload native Luau UI (Frame, UICorner, UIGradient, UIStroke) with pixel-exact rbxassetid ImageLabels when creating Roblox UI with AI.

When creating Roblox UI with an AI agent, every screen forces an architectural decision: should the compiled ScreenGui render as pure Roblox GUI instances (Frame, UICorner, UIGradient, UIStroke), or as ImageLabel bitmaps uploaded to Roblox (rbxassetid://)?

You do not have to commit to one approach for an entire project. penui supports both rendering modes from the same Figma metadata—and lets an agent prototype natively first, then promote hero panels to pixel-exact artwork with zero layout rewrites.

How native Luau synthesis works (mode: "native")

For structural categories—button, close-button, panel, header, tile, bar, and input (excluding full-screen composites)—penui can compile a zero-image approximation directly from the component's Figma design tokens:

In mode: "auto", if no rbxassetid:// is registered yet for a compatible category, penui falls back to native automatically so your script runs immediately in Roblox Studio without waiting on asset moderation or upload credentials.

How pixel-exact bitmap mode works (mode: "asset")

When you want the designer's actual bevels, glossy specular highlights, stud patterns, ornate ribbons, or outer neon glows, mode: "asset" emits ImageLabels pointing to uploaded rbxassetid:// textures:

Performance, memory, and visual trade-offs

The recommended hybrid workflow

Combine both modes inside the same screen:

  1. Draft and validate natively: Run decide_screen → preview_units → compose_units with native components while dialing in hierarchy, button copy, safe-area padding, and mobile UIScale caps.
  2. Keep simple geometry native: Progress bars, flat dark modal backdrops, input boxes, and solid-color containers often look cleaner and lighter as native Frame + UIStroke instances even in production.
  3. Promote hero art to bitmaps: Upload only your ornate headers, primary CTA buttons, currency badges, and CC0 icons via upload_unit_assets + Studio upload_image + register_uploaded_assets. Once their IDs are recorded in library/roblox-ids.json, re-running compose_units automatically switches those pieces to mode: "asset" while keeping the exact same coordinates and TextLabel bindings.

Frequently asked questions

Which penui component categories can build natively without uploading images?

Seven categories support native Frame + UICorner + UIGradient + UIStroke synthesis: button, close-button, panel, header, tile, bar, and input (excluding full-screen composites). Icons and ornate multi-layer art require uploaded PNGs.

How do I switch a native ScreenGui to pixel-exact Figma art later?

Stage and upload the unit PNGs with upload_unit_assets, Studio upload_image, and register_uploaded_assets (or Open Cloud with ROBLOX_API_KEY). Once the rbxassetids are stored in library/roblox-ids.json, re-run compose_units or compose_screen in auto or asset mode.

What happens if a Figma panel is larger than Roblox's 1024px image limit?

penui automatically splits images exceeding 1024px into sub-tiles and generates an ASSET_TILES Luau table using UDim2.fromScale fractions inside a container Frame so Roblox does not blur or downsample the artwork.

Is native mode better for mobile Roblox performance?

Native instances use negligible texture memory, never pop in over the network, and scale sharply at any resolution. A common production pattern is keeping simple bars, backdrops, and inputs native while uploading bitmap art for hero headers, buttons, and CC0 icons.

Install the MCP server · All posts · RSS feed