Added separate landscape/portrait Early/Late pos.

This commit is contained in:
domdoc 2022-05-25 20:32:50 +02:00
parent 962f2c27d7
commit 39631eb320
1 changed files with 16 additions and 7 deletions

View File

@ -11,16 +11,23 @@ local compare = {
["OFF"] = -1 ["OFF"] = -1
} }
local heightFractions = { local portraitHeightFractions = {
["UPPER+"] = 2, ["UPPER+"] = 2.4,
["UPPER"] = 3, ["UPPER"] = 3,
["STANDARD"] = 3.5, ["STANDARD"] = 4,
["LOWER"] = 5, ["LOWER"] = 5.3,
}
local landscapeHeightFractions = {
["UPPER+"] = 1.4,
["UPPER"] = 2.7,
["STANDARD"] = 5.1,
["LOWER"] = 6.7,
} }
local earlyLateFor = compare[game.GetSkinSetting("gameplay_earlyLateFor")] local earlyLateFor = compare[game.GetSkinSetting("gameplay_earlyLateFor")]
local msFor = compare[game.GetSkinSetting("gameplay_msFor")] local msFor = compare[game.GetSkinSetting("gameplay_msFor")]
local heightFraction = heightFractions[game.GetSkinSetting("gameplay_earlyLatePosition")] local earlyLatePosition = game.GetSkinSetting("gameplay_earlyLatePosition")
local EarlyLate = { local EarlyLate = {
timer = 0, timer = 0,
@ -39,16 +46,18 @@ function EarlyLate.render(deltaTime)
local screenW, screenH = Dimensions.screen.width, Dimensions.screen.height local screenW, screenH = Dimensions.screen.width, Dimensions.screen.height
local screenCenterX = screenW / 2 local screenCenterX = screenW / 2
local desh local desh, fractionTable
if screenH > screenW then if screenH > screenW then
desh = 1920 desh = 1920
fractionTable = portraitHeightFractions
else else
desh = 1080 desh = 1080
fractionTable = landscapeHeightFractions
end end
local scale = screenH / desh local scale = screenH / desh
local y = screenH / 8 * heightFraction local y = screenH / 8 * fractionTable[earlyLatePosition]
gfx.BeginPath() gfx.BeginPath()
gfx.LoadSkinFont("Digital-Serial-Bold.ttf") gfx.LoadSkinFont("Digital-Serial-Bold.ttf")