-- Revised from Triteleia's script -- Creates a new image from the given filename local filename = "white.jpg" local new_bg = Scene.createSprite(filename, "default", "background") -- Set a scale that makes it properly match the BG size for that image size new_bg.scaleX = 320/3 new_bg.scaleY = 320/3 new_bg.layer.addKey(0, "UI") new_bg.sort.addKey(0, 9999) new_bg.colorA.addKey(0, 0) new_bg.alpha.addKey(0, 0) new_bg.setParent(Scene.hud) addScenecontrol("whitemask", {"end_timing","alpha","easing"}, function(cmd) local timing = cmd.timing local end_timing = cmd.args[1] local alpha = cmd.args[2] local easing = cmd.args[3] -- Adds two keys to the alpha value channel associated with the BG -- The first key uses the start alpha value and is used to make sure the alpha value of the BG doesn't change -- between multiple usages of bgshow on the same BG -- The second key is the one that actually changes the BG's alpha to the desired value bg_alpha_channels[filename] .addKey(timing, start_alpha, easing) .addKey(end_timing, alpha) end)