Skip to content

Commit

Permalink
Added GetContainer method
Browse files Browse the repository at this point in the history
  • Loading branch information
blinkybool committed Dec 19, 2023
1 parent 61b6136 commit f1ad09c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/Server/BoardServer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,17 @@ function BoardServer:GetPart(): Part
return self._obj
end

function BoardServer:GetContainer(): Model | BasePart
if self._obj.Parent
and self._obj.Parent:IsA("Model")
and self._obj.Parent.PrimaryPart == self._obj
then
return self._obj.Parent
else
return self._obj
end
end

function BoardServer:GetAspectRatio(): number
local surfaceSize = self.SurfaceSize.Value
return surfaceSize.X / surfaceSize.Y
Expand Down

0 comments on commit f1ad09c

Please sign in to comment.