local a={}a.ClassName="\083\112\114\105\116\101"a.__index=a function a.new(C)assert(C.Texture)assert(C.Size)assert(C.Position)assert(C.Name)local P=setmetatable(C,a)return P end function a.Style(C,a)a.Size=UDim2.new(0,C.Size.X,0,C.Size.Y)a.ImageRectOffset=C.Position a.ImageRectSize=C.Size return a end function a.Get(C,a)local P=Instance.new(a)P.Name=C.Name P.BackgroundTransparency=1 P.BorderSizePixel=1 P.Image=C.Texture C:Style(P)return P end return a
---
-- @classmod Sprite

local Sprite = {}
Sprite.ClassName = "Sprite"
Sprite.__index = Sprite

function Sprite.new(data)
	assert(data.Texture)
	assert(data.Size)
	assert(data.Position)
	assert(data.Name)

	local self = setmetatable(data, Sprite)

	return self
end

function Sprite:Style(gui)
	gui.Size = UDim2.new(0, self.Size.X, 0, self.Size.Y)
	gui.ImageRectOffset = self.Position
	gui.ImageRectSize = self.Size

	return gui
end

function Sprite:Get(instanceType)
	local gui = Instance.new(instanceType)
	gui.Name = self.Name
	gui.BackgroundTransparency = 1
	gui.BorderSizePixel = 1
	gui.Image = self.Texture

	self:Style(gui)

	return gui
end

return Sprite