Klasa silnika
VideoFrame
*Ta zawartość została przetłumaczona przy użyciu narzędzi AI (w wersji beta) i może zawierać błędy. Aby wyświetlić tę stronę w języku angielskim, kliknij tutaj.
Podsumowanie
Właściwości
Video:ContentId |
Zdarzenia
DidLoop(video: string):RBXScriptSignal |
Ended(video: string):RBXScriptSignal |
Loaded(video: string):RBXScriptSignal |
Paused(video: string):RBXScriptSignal |
Played(video: string):RBXScriptSignal |
Przykłady kodu
Tworzenie i Odtwarzanie Wideo
local screenPart = Instance.new("Part")
screenPart.Parent = workspace
local surfaceGui = Instance.new("SurfaceGui")
surfaceGui.Parent = screenPart
local videoFrame = Instance.new("VideoFrame")
videoFrame.Parent = surfaceGui
videoFrame.Looped = true
videoFrame.Video = "rbxassetid://" -- dodaj identyfikator zasobu tutaj
while not videoFrame.IsLoaded do
task.wait()
end
videoFrame:Play()Materiały referencyjne dotyczące interfejsów API
Właściwości
Video
VideoFrame.Video:ContentId
Przykłady kodu
Tworzenie i Odtwarzanie Wideo
local screenPart = Instance.new("Part")
screenPart.Parent = workspace
local surfaceGui = Instance.new("SurfaceGui")
surfaceGui.Parent = screenPart
local videoFrame = Instance.new("VideoFrame")
videoFrame.Parent = surfaceGui
videoFrame.Looped = true
videoFrame.Video = "rbxassetid://" -- dodaj identyfikator zasobu tutaj
while not videoFrame.IsLoaded do
task.wait()
end
videoFrame:Play()Metody
Pause
VideoFrame:Pause():()
Zwroty
()
Play
VideoFrame:Play():()
Zwroty
()
Przykłady kodu
Tworzenie i Odtwarzanie Wideo
local screenPart = Instance.new("Part")
screenPart.Parent = workspace
local surfaceGui = Instance.new("SurfaceGui")
surfaceGui.Parent = screenPart
local videoFrame = Instance.new("VideoFrame")
videoFrame.Parent = surfaceGui
videoFrame.Looped = true
videoFrame.Video = "rbxassetid://" -- dodaj identyfikator zasobu tutaj
while not videoFrame.IsLoaded do
task.wait()
end
videoFrame:Play()Zdarzenia