print("init Loading Window begin");


local delay = 0
local fadeTime = 1.5

local menu = game:getSceneManager():getLoadingWindow()
menu:getRoot():SetZDepth( 10 )
local vault = resourceManager:getVault(ResourceManager.LOADING)


local bg = KrSprite(vault:GetSpriteResource("loadingMainBg"))

-- bg:SetPos(100, 200, -1)

aniFadeInFadeOut(bg, delay, fadeTime, fadeTime, 255)
menu:setMainBgSprite(bg)

bg = KrSprite(vault:GetSpriteResource("loadingProgressBg"))
bg:SetPos(512, 710, -1)

aniFadeInFadeOut(bg, delay, fadeTime, fadeTime, 255)
menu:setLoadingBgSprite(bg)

bg = KrSprite(vault:GetSpriteResource("loadingProgressFg"))
bg:SetPos(512, 710, -1)

aniFadeInFadeOut(bg, delay, fadeTime, fadeTime, 255)
menu:setLoadingFgSprite(bg)

-- create and init textBox

local width = 250;
local height= 150;

local textBox = KrTextBox(game:getFontResource("occ24"), width, height, 2, KrTextBox.CENTER);

textBox:SetPos(300, 300, -1);

aniFadeInFadeOut(textBox, delay, fadeTime, fadeTime, 255)
menu:setTextBox(textBox);

-- end crate text box


print("init Loading Window end");


