* further changes to bg
This commit is contained in:
parent
4b8d7de782
commit
ff0e21ff2b
|
@ -13,7 +13,10 @@ local footerY = desh - FOOTER_HEIGHT;
|
|||
local bgBaseImage = gfx.CreateSkinImage("components/background/bg.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
|
||||
local transitionRotateScale = 0;
|
||||
|
@ -26,34 +29,106 @@ function resetLayoutInformation()
|
|||
scale = resx / desw
|
||||
end
|
||||
|
||||
local drawValkyrie = function (piProgression)
|
||||
local drawValkyrie = function (spinProgressionScale, valkImage)
|
||||
gfx.Save()
|
||||
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)
|
||||
gfx.Scale(math.sin(piProgression)*distanceScaleMultiplier, 1*distanceScaleMultiplier)
|
||||
gfx.SkewY(-math.sin(piProgression+0.5*math.pi)*0.3)
|
||||
local distanceScaleMultiplier = 0.3 + 0.7*((1+math.sin(piProgression))/2)
|
||||
|
||||
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()
|
||||
|
||||
|
||||
-- ===================== 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
|
||||
|
||||
local drawValkyries = function ()
|
||||
gfx.Save()
|
||||
gfx.BeginPath()
|
||||
|
||||
local piProgression = transitionRotateScale*2*math.pi
|
||||
drawValkyrie(piProgression)
|
||||
drawValkyrie(piProgression+math.pi*0.5)
|
||||
drawValkyrie(piProgression+math.pi*1.0)
|
||||
drawValkyrie(piProgression+math.pi*1.5)
|
||||
gfx.Rotate(-0.3)
|
||||
|
||||
drawValkyrie(transitionRotateScale, valkRasisImage)
|
||||
|
||||
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
|
||||
|
||||
local drawBackground = function ()
|
||||
gfx.BeginPath();
|
||||
gfx.ImageRect(0, 0, desw, desh, bgBaseImage, 1, 0);
|
||||
|
||||
drawRings();
|
||||
|
||||
drawValkyries();
|
||||
|
||||
gfx.BeginPath();
|
||||
|
|
|
@ -324,7 +324,7 @@ end
|
|||
|
||||
render = function(deltaTime)
|
||||
if not playedBgm then
|
||||
game.PlaySample('titlescreen/bgm.wav', true);
|
||||
--game.PlaySample('titlescreen/bgm.wav', true);
|
||||
playedBgm = true;
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue