* further changes to bg

This commit is contained in:
FajsiEx 2021-08-22 19:15:18 +02:00
parent 4b8d7de782
commit ff0e21ff2b
2 changed files with 87 additions and 12 deletions

View File

@ -13,7 +13,10 @@ local footerY = desh - FOOTER_HEIGHT;
local bgBaseImage = gfx.CreateSkinImage("components/background/bg.png", 0); local bgBaseImage = gfx.CreateSkinImage("components/background/bg.png", 0);
local dotsOverlayImage = gfx.CreateSkinImage("components/background/dots.png", 0); local dotsOverlayImage = gfx.CreateSkinImage("components/background/dots.png", 0);
local valk1Image = gfx.CreateSkinImage("components/background/test.png", 0); local valkRasisImage = gfx.CreateSkinImage("components/background/rasis_panel.png", 0);
local valkGraceImage = gfx.CreateSkinImage("components/background/grace_panel.png", 0);
local mainRingImage = gfx.CreateSkinImage("components/background/main_ring.png", 0);
-- Animation related -- Animation related
local transitionRotateScale = 0; local transitionRotateScale = 0;
@ -26,34 +29,106 @@ function resetLayoutInformation()
scale = resx / desw scale = resx / desw
end end
local drawValkyrie = function (piProgression) local drawValkyrie = function (spinProgressionScale, valkImage)
gfx.Save() gfx.Save()
gfx.BeginPath() gfx.BeginPath()
local distanceScaleMultiplier = (math.sin(piProgression)+math.pi)*0.25 + 0.25 local w = 1390*0.7;
local h = 3356*0.7
local piProgression = spinProgressionScale*2*math.pi
gfx.Translate(math.sin(piProgression+2)*0.6*desw+0.5*desw,-math.sin(piProgression+2)*0.1*desh+desh*0.1) local distanceScaleMultiplier = 0.3 + 0.7*((1+math.sin(piProgression))/2)
gfx.Scale(math.sin(piProgression)*distanceScaleMultiplier, 1*distanceScaleMultiplier)
gfx.SkewY(-math.sin(piProgression+0.5*math.pi)*0.3)
gfx.ImageRect(0, 0, 540, 960, valk1Image, 1, 0);
local xScale = math.sin(piProgression)*distanceScaleMultiplier;
local yScale = 1*distanceScaleMultiplier
gfx.Translate(math.sin(piProgression+2)*0.6*desw+0.3*desw, (1-distanceScaleMultiplier)*desh*0.4) -- -math.sin(piProgression+2)*0.1*desh+desh*0.1
-- gfx.Scale(xScale, yScale)
gfx.SkewY(
(
1 +
math.sin(
piProgression +
0.5 *
math.pi
)
) / 2
* -0.3)
--gfx.SkewX(-math.sin(piProgression)*0.2)
gfx.ImageRect(0, 0, w*xScale, h*yScale, valkImage, 0.5, 0);
gfx.Restore() gfx.Restore()
-- ===================== Draw the inner one
gfx.Save()
gfx.BeginPath()
local w = 1390*0.7;
local h = 3356*0.7
local piProgression = spinProgressionScale*2*math.pi
local distanceScaleMultiplier = 0.3 + 0.7*((1+math.sin(piProgression))/2)
local xScale = math.sin(piProgression)*distanceScaleMultiplier;
local yScale = 1*distanceScaleMultiplier
gfx.Translate(math.sin(piProgression+2)*0.57*desw+0.3*desw, (1-distanceScaleMultiplier)*desh*0.4) -- -math.sin(piProgression+2)*0.1*desh+desh*0.1
-- gfx.Scale(xScale, yScale)
gfx.SkewY(
(
1 +
math.sin(
piProgression +
0.5 *
math.pi
)
) / 2
* -0.3)
--gfx.SkewX(-math.sin(piProgression)*0.2)
gfx.ImageRect(0, 0, w*xScale, h*yScale, valkImage, 0.5, 0);
gfx.Restore()
end end
local drawValkyries = function () local drawValkyries = function ()
gfx.Save()
gfx.BeginPath() gfx.BeginPath()
local piProgression = transitionRotateScale*2*math.pi local piProgression = transitionRotateScale*2*math.pi
drawValkyrie(piProgression) gfx.Rotate(-0.3)
drawValkyrie(piProgression+math.pi*0.5)
drawValkyrie(piProgression+math.pi*1.0) drawValkyrie(transitionRotateScale, valkRasisImage)
drawValkyrie(piProgression+math.pi*1.5)
drawValkyrie(transitionRotateScale+0.25, valkGraceImage)
drawValkyrie(transitionRotateScale+0.5, valkRasisImage)
drawValkyrie(transitionRotateScale+0.75, valkGraceImage)
gfx.Restore()
end
local drawRings = function ()
gfx.Save()
gfx.BeginPath()
gfx.SkewX(-0.95)
gfx.Translate(675,225)
gfx.Rotate(-transitionRotateScale*2*math.pi);
gfx.Translate(-200,-200)
gfx.ImageRect(0, 0, 400, 400, mainRingImage, 0.5, 0);
gfx.Restore()
end end
local drawBackground = function () local drawBackground = function ()
gfx.BeginPath(); gfx.BeginPath();
gfx.ImageRect(0, 0, desw, desh, bgBaseImage, 1, 0); gfx.ImageRect(0, 0, desw, desh, bgBaseImage, 1, 0);
drawRings();
drawValkyries(); drawValkyries();
gfx.BeginPath(); gfx.BeginPath();

View File

@ -324,7 +324,7 @@ end
render = function(deltaTime) render = function(deltaTime)
if not playedBgm then if not playedBgm then
game.PlaySample('titlescreen/bgm.wav', true); --game.PlaySample('titlescreen/bgm.wav', true);
playedBgm = true; playedBgm = true;
end end