Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local makeInventoryGrids = {}
- function makeInventoryGrids:Create(size,name,sizeInPixels,position,parent)
- --//Grid Lines math and bar math
- local barsizeY = 30/sizeInPixels -- so if it was 30/90 size would be 0.3333
- local startingPointY = 30/sizeInPixels
- local endingPointY = sizeInPixels/30-1
- --//Create Grid
- local frame = Instance.new('Frame')
- local bar = Instance.new('Frame')
- local xGrid = Instance.new('Frame')
- local yGrid = Instance.new('Frame')
- frame.Name = 'ContainerGrid'
- bar.Name = 'Bar'
- xGrid.Name = 'XGrid'
- yGrid.Name = 'YGrid'
- frame.Size = size
- frame.Position = position
- frame.BackgroundColor3 = Color3.fromRGB(255,255,255)
- frame.BackgroundTransparency = .8
- frame.BorderSizePixel = 0
- xGrid.Size = UDim2.new(1,0,0,1)
- xGrid.BorderSizePixel = 0
- xGrid.BackgroundTransparency = .7
- xGrid.BackgroundColor3 = Color3.fromRGB(255,255,255)
- yGrid.Size = UDim2.new(0,1,1,0)
- yGrid.BackgroundColor3 = Color3.fromRGB(255,255,255)
- yGrid.BorderSizePixel = 0
- yGrid.BackgroundTransparency = .7
- --//CreateBar and contents in it
- bar.Size = UDim2.new(1,0,barsizeY,0)
- bar.Position = UDim2.new(0,0,-barsizeY,0)
- bar.BorderSizePixel = 0
- bar.BackgroundColor3 = Color3.fromRGB(31,31,31)
- local button = Instance.new('TextButton')
- button.BackgroundColor3 = Color3.fromRGB(255,255,255)
- button.BackgroundTransparency = .4
- button.BorderSizePixel = 0
- button.Size = UDim2.new(0.1,0,1,0)
- button.TextScaled = true
- button.TextColor3 = Color3.fromRGB(255,255,255)
- button.Text = '-'-- will alternate
- local text = Instance.new('TextLabel')
- text.AnchorPoint = Vector2.new(0,0)
- text.Position = UDim2.new(0.1,0,0,0)
- text.Size = UDim2.new(.9,0,1,0)
- text.BackgroundColor3 = Color3.fromRGB(255,255,255)
- text.TextColor3 = Color3.fromRGB(255,255,255)
- text.TextXAlignment = Enum.TextXAlignment.Left
- text.TextScaled = true
- text.BackgroundTransparency = .9
- text.BorderSizePixel = 0
- text.Text = tostring(name)
- text.Parent = bar
- button.Parent = bar
- bar.Parent = frame
- frame.Parent = parent
- --//Create Grids
- --//XGridsCreate
- for i = startingPointY,startingPointY*endingPointY,startingPointY do
- local cloneOfXGrid = xGrid:Clone()
- cloneOfXGrid.AnchorPoint = Vector2.new(0,i)
- cloneOfXGrid.Position = UDim2.new(0,0,i,0)
- cloneOfXGrid.Parent = frame
- end
- return frame,sizeInPixels
- end
- --[[
- Algorithms:
- (.033 +.033 * 3)+.001
- --]]
- return makeInventoryGrids
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement