Skip to content

Search documentation

Enter at least two characters.

    FrameSurface

    SDK 0.1.0-preview.2 · ExperimentalDownload & release notes ↗

    An advanced, experimental control for submitting a buffer of image pixels. Ordinary images belong in ImageLabel.

    Advanced app/host integration API. Useful for lower-level work; ordinary app authors can start with the app-building path. This is public API, not permission to access private toolkit objects.

    Create: Instance.new("FrameSurface", {...}). Inherits: GuiObject.

    Parent and children: Use Window, Frame or ScrollingFrame as the Parent. It does not accept visual child content.

    Advanced experimental pixel submission. Check PlatformService:Supports(“FrameSurface”) before depending on this feature; prefer ImageLabel for ordinary images.

    Where to put it: replace Src/Main.luau in a project created with this SDK. This is the complete entry file.

    local Window = Instance.new("Window", {
    Title = "LUI example", Size = UDim2.fromOffset(560, 280),
    })
    local Status = Instance.new("TextLabel", {
    Parent = Window, Text = "Ready", Position = UDim2.fromOffset(16, 170),
    Size = UDim2.new(1, -32, 0, 72),
    })
    local Surface = Instance.new("FrameSurface", {Parent = Window, Size = UDim2.fromOffset(128, 128)})
    local Pixels = buffer.create(4) -- One BGRA pixel, four bytes.
    buffer.writeu8(Pixels, 2, 255) -- Red.
    buffer.writeu8(Pixels, 3, 255) -- Fully opaque.
    local Accepted = Surface:SubmitFrame(Pixels, 1, 1, 4, "BGRA8Premultiplied")
    Status.Text = if Accepted then "Frame accepted; presentation is host-dependent" else "Frame submission refused"
    Window.Visible = true

    Expected result: The status reports whether the host accepted the pixel buffer. It does not claim that visible presentation is qualified.

    • Use ImageLabel for a declared image. FrameSurface is for advanced pixel producers and framework experiments.
    • Only BGRA8Premultiplied, up to 1920×1080 and an 8 MiB stride×height bound, is admitted. Input is copied.
    • Production fenced presentation and GTK presentation remain unqualified. A sample can demonstrate buffer submission without proving visible output.

    How submitted pixels fit the control: Fit preserves the whole image, Fill fills it with cropping, and Stretch fills it without preserving proportions.

    Type: string. Default: Fit; Fill or Stretch. Read/write field.

    Empty, Pending, Ready or Failed. Ready means shared consumption, not proof that a physical display showed the frame.

    Type: string. Default: Empty; Pending, Ready or Failed (Ready never implies visible presentation). Read-only.

    Copies BGRA8Premultiplied pixels. Supply positive dimensions and RowStride in bytes, within 1920×1080 and 8 MiB. Returns acceptance and an optional reason; acceptance is not visible presentation.

    SubmitFrame(Pixels: buffer, Width: number, Height: number, RowStride: number, Format: string) -> (boolean, string?)

    Releases the current frame and returns the surface to its empty state.

    ClearFrame() -> ()

    You can use these directly on FrameSurface. Follow a member link for its explanation and example.

    Visible · AccessibilityLabel · AccessibilityDescription · Size · Position · AnchorPoint · LayoutOrder · BackgroundColor3 · BackgroundTransparency · BorderColor3 · BorderSizePixel · CornerRadius · Opacity · TextColor3 · TextSize · FontFamily · FontWeight · TextWrapped · TextXAlignment · TextYAlignment · ZIndex · ClipsDescendants · IsFocused · AbsolutePosition · AbsoluteSize · Focus · Focused · FocusLost · MouseEnter · MouseLeave · InputBegan · InputChanged · InputEnded

    Name · Sensitive · EffectiveSensitive · Parent · ClassName · Destroy · Clone · GetChildren · GetDescendants · FindFirstChild · IsA · Changed · Destroying

    Full type declaration — for type checking and deeper reference

    The declaration is generated from the SDK. Self is supplied by a colon call; read means the field cannot be assigned. See how to read this reference.

    export type FrameSurface = GuiObject & {
    ScaleMode: string,
    read FrameState: string,
    read SubmitFrame: (Self: FrameSurface, Pixels: buffer, Width: number, Height: number, RowStride: number, Format: string) -> (boolean, string?),
    read ClearFrame: (Self: FrameSurface) -> (),
    }

    See platform limits before relying on host-specific behavior. The framework design specification and reflection/type sources are deeper engineering references, not extra setup required to build an app.