-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path3d-library-test
More file actions
81 lines (69 loc) · 2.48 KB
/
3d-library-test
File metadata and controls
81 lines (69 loc) · 2.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
local RunService = game:GetService("RunService")
local Workspace = game:GetService("Workspace")
local Library3D = {}
-- Yeni pencere oluştur
function Library3D:CreateWindow(title, offset)
offset = offset or Vector3.new(0, 0, -5) -- Kamera önündeki mesafe
local window = {}
-- Part (3D panel)
local part = Instance.new("Part")
part.Size = Vector3.new(12, 7, 0.3)
part.Anchored = true
part.CanCollide = false
part.Material = Enum.Material.Neon
part.Transparency = 0
part.Color = Color3.fromRGB(20, 20, 20)
part.CastShadow = false
part.Parent = Workspace
-- SurfaceGui
local surfaceGui = Instance.new("SurfaceGui")
surfaceGui.Adornee = part
surfaceGui.Face = Enum.NormalId.Front
surfaceGui.AlwaysOnTop = true
surfaceGui.ResetOnSpawn = false
surfaceGui.Parent = part
surfaceGui.ClipsDescendants = true
surfaceGui.SizingMode = Enum.SurfaceGuiSizingMode.PixelsPerStud
surfaceGui.PixelsPerStud = 50
surfaceGui.CanvasSize = Vector2.new(600, 350)
-- Başlık Label
local titleLabel = Instance.new("TextLabel")
titleLabel.Size = UDim2.new(1, 0, 0, 40)
titleLabel.BackgroundColor3 = Color3.fromRGB(10, 10, 10)
titleLabel.TextColor3 = Color3.new(1, 1, 1)
titleLabel.Font = Enum.Font.SourceSansBold
titleLabel.TextSize = 28
titleLabel.Text = title or "3D GUI Window"
titleLabel.Parent = surfaceGui
-- İçerik Frame (buraya diğer elementleri ekleyebilirsin)
local contentFrame = Instance.new("Frame")
contentFrame.Size = UDim2.new(1, 0, 1, -40)
contentFrame.Position = UDim2.new(0, 0, 0, 40)
contentFrame.BackgroundTransparency = 1
contentFrame.Parent = surfaceGui
window.Part = part
window.SurfaceGui = surfaceGui
window.Content = contentFrame
-- Kameraya göre Part'ı konumlandır (her frame)
local camera = Workspace.CurrentCamera
window.Connection = RunService.RenderStepped:Connect(function()
if camera and part then
local camCFrame = camera.CFrame
local newCFrame = camCFrame * CFrame.new(offset)
part.CFrame = newCFrame * CFrame.Angles(0, math.rad(180), 0)
end
end)
-- Fonksiyon: pencereyi kapat
function window:Destroy()
if self.Connection then
self.Connection:Disconnect()
self.Connection = nil
end
if self.Part then
self.Part:Destroy()
self.Part = nil
end
end
return window
end
return Library3D