--[[ Use Examples

-- To be used on the client.
local fullscreenModule = require(game:GetService("ReplicatedStorage"):WaitForChild("FullscreenModule"))
local screen = workspace:WaitForChild("CountdownBoardPart")

-- Creates a button that allows the user to toggle focus on a screen
fullscreenModule.CreateButtonToFocusScreen(screen)

fullscreenModule.FocusScreen(screen)	-- Forces the client to focus on a screen
wait(5)
fullscreenModule.FocusScreen()	-- Forces the client to focus back on their character

]]


local fullscreenModule = {}
fullscreenModule.FocusedScreen = nil

local TweenService = game:GetService("TweenService")
local PlayersService = game:GetService("Players")
local RunService = game:GetService("RunService")
local StarterPlayer = game:GetService("StarterPlayer")
local UserInputService = game:GetService("UserInputService")

local buttonGuiTemplate = script:WaitForChild("FullscreenButtonGui")
local localPlayer = PlayersService.LocalPlayer
local camera = workspace.CurrentCamera
local buttonGui = nil
local button = nil
local buttonTargetScreen = nil
local buttonConnection = nil
local gamepadButtonConnection = nil
local lockCameraConnection = nil
local characterCamCF = nil
local characterCamCFIsRelative = false
local transitionCount = 0

local ZOOM_IN_ICON = "rbxassetid://9597519667"
local ZOOM_OUT_ICON = "rbxassetid://9597519299"

local FULLSCREEN_GAMEPAD_BUTTON = Enum.KeyCode.ButtonY
local FULLSCREEN_GAMEPAD_BUTTON_ICON = "rbxassetid://9596106684"
local BACKOUT_GAMEPAD_BUTTON = Enum.KeyCode.ButtonB
local BACKOUT_GAMEPAD_BUTTON_ICON = "rbxassetid://9596106237"
