parent
b586a217a3
commit
98ab8bfb62
|
@ -21,7 +21,7 @@ local dimtable = {
|
||||||
|
|
||||||
dimtable.screen.width, dimtable.screen.height = game.GetResolution()
|
dimtable.screen.width, dimtable.screen.height = game.GetResolution()
|
||||||
|
|
||||||
local function transformToDesignSpace()
|
local function transformToScreenSpace()
|
||||||
gfx.Translate((dimtable.screen.width - dimtable.view.width) / 2, 0);
|
gfx.Translate((dimtable.screen.width - dimtable.view.width) / 2, 0);
|
||||||
gfx.Scale(dimtable.view.width / dimtable.design.width, dimtable.view.height / dimtable.design.height);
|
gfx.Scale(dimtable.view.width / dimtable.design.width, dimtable.view.height / dimtable.design.height);
|
||||||
gfx.Scissor(0, 0, dimtable.design.width, dimtable.design.height);
|
gfx.Scissor(0, 0, dimtable.design.width, dimtable.design.height);
|
||||||
|
@ -43,6 +43,6 @@ end
|
||||||
-- return by reference trickery:
|
-- return by reference trickery:
|
||||||
|
|
||||||
local t = dimtable
|
local t = dimtable
|
||||||
t.transformToDesignSpace = transformToDesignSpace
|
t.transformToScreenSpace = transformToScreenSpace
|
||||||
t.updateResolution = updateResolution
|
t.updateResolution = updateResolution
|
||||||
return t
|
return t
|
|
@ -25,10 +25,8 @@ local splash1SfxPlayed = false
|
||||||
local function calcFade(splashDuration)
|
local function calcFade(splashDuration)
|
||||||
local t = splashDuration - splashTimer
|
local t = splashDuration - splashTimer
|
||||||
if t < fadeDuration then
|
if t < fadeDuration then
|
||||||
game.Log("fade in: ", game.LOGGER_ERROR)
|
|
||||||
fadeAlpha = Easing.linear(t, 0, 255, fadeDuration) -- fade in
|
fadeAlpha = Easing.linear(t, 0, 255, fadeDuration) -- fade in
|
||||||
elseif splashTimer < fadeDuration then
|
elseif splashTimer < fadeDuration then
|
||||||
game.Log("fade out: ", game.LOGGER_ERROR)
|
|
||||||
fadeAlpha = Easing.linear(splashTimer, 0, 255, fadeDuration) -- fade out
|
fadeAlpha = Easing.linear(splashTimer, 0, 255, fadeDuration) -- fade out
|
||||||
else
|
else
|
||||||
--fadeAlpha = 255
|
--fadeAlpha = 255
|
||||||
|
@ -116,7 +114,7 @@ function render(deltaTime)
|
||||||
BGPattern.render()
|
BGPattern.render()
|
||||||
|
|
||||||
gfx.BeginPath()
|
gfx.BeginPath()
|
||||||
Dim.transformToDesignSpace()
|
Dim.transformToScreenSpace()
|
||||||
gfx.Rect(0, 0, Dim.design.width, Dim.design.height)
|
gfx.Rect(0, 0, Dim.design.width, Dim.design.height)
|
||||||
gfx.FillColor(0, 0, 0)
|
gfx.FillColor(0, 0, 0)
|
||||||
gfx.Fill()
|
gfx.Fill()
|
||||||
|
|
Loading…
Reference in New Issue