Slight revamp on BG image handling
- The game can now load more than 20 backgrounds by putting them in /res/backgrounds in the save directory - If a gamemode tries to set its background to an ID higher than the max it will be clamped down to the last background loaded
This commit is contained in:
@@ -979,9 +979,11 @@ function GameMode:drawSectionTimesWithSplits(current_section, section_limit)
|
||||
end
|
||||
|
||||
function GameMode:drawBackground()
|
||||
local id = self:getBackground()
|
||||
if type(id) == "number" then id = clamp(id, 0, #backgrounds) end
|
||||
love.graphics.setColor(1, 1, 1, 1)
|
||||
love.graphics.draw(
|
||||
backgrounds[self:getBackground()],
|
||||
backgrounds[id],
|
||||
0, 0, 0,
|
||||
0.5, 0.5
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user