Motor Sınıfı
BasePlayerGui
*Bu içerik, yapay zekâ (beta) kullanılarak çevrildi ve hatalar içerebilir. Sayfayı İngilizce görüntülemek için buraya tıkla.
API Referansı
Yöntemler
GetGuiObjectsAtPosition
Dönüşler
Instances
Kod Örnekleri
Bir Pozisyonda GUI Seçimi
local UserInputService = game:GetService("UserInputService")
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local playerGui = player:WaitForChild("PlayerGui")
-- Vurgulayıcı Frame'leri içerecek bir Dizin ve ScreenGui oluştur
local highlights = Instance.new("Folder")
highlights.Name = "Highlights"
highlights.Parent = playerGui
local highlightsContainer = Instance.new("ScreenGui")
highlightsContainer.Name = "Container"
highlightsContainer.Parent = highlights
highlightsContainer.DisplayOrder = 99999
-- Aynı AbsoluteSize ve AbsolutePosition'a sahip yarı saydam sarı bir Frame oluşturur
local function highlightAsFrame(gui)
local highlight = Instance.new("Frame")
highlight.Name = "Highlight"
highlight.Parent = highlightsContainer
highlight.Size = UDim2.new(0, gui.AbsoluteSize.X, 0, gui.AbsoluteSize.Y)
highlight.Position = UDim2.new(0, gui.AbsolutePosition.X, 0, gui.AbsolutePosition.Y)
highlight.BackgroundColor3 = Color3.fromRGB(255, 255, 10) -- Sarı
highlight.BackgroundTransparency = 0.75
highlight.BorderSizePixel = 0
highlight.LayoutOrder = gui.LayoutOrder - 1
end
-- Girişin pozisyonunda tüm GuiOlaylarını almak ve vurgulamak için GetGuiObjectsAtPosition kullan
local function highlightGui(input, _gameProcessed)
local pos = input.Position
local guisAtPosition = playerGui:GetGuiObjectsAtPosition(pos.X, pos.Y)
highlightsContainer:ClearAllChildren()
for _, gui in ipairs(guisAtPosition) do
if gui:IsA("GuiObject") then
highlightAsFrame(gui)
end
end
end
-- Giriş türü MouseButton1 veya Touch ise InputBegan'da highlightGui'yi tetikle
local function InputBegan(input, gameProcessed)
local inputType = input.UserInputType
local touch = Enum.UserInputType.Touch
local mouse1 = Enum.UserInputType.MouseButton1
if inputType == touch or inputType == mouse1 then
highlightGui(input, gameProcessed)
end
end
UserInputService.InputBegan:Connect(InputBegan)