I'm having some trouble getting this to work, the library works perfectly fine when I run it from the demo mod but upon trying to implement it into another mod I get severe slowdown.
I've checked all textures are registered and their filepaths are correct, all functions related to the Parallax file are where they should be, I've even tried copying the demo mod code verbatim but it still results in immense slowdown.
The only error I get in the console is the game yelling about a static texture being re-uploaded every frame, which is what I assume is the cause for lag.
Parallax = dofile_once( "mods/Apotheosis/files/scripts/parallax_backgrounds/parallax.lua" )
dofile_once("mods/Apotheosis/files/scripts/parallax_backgrounds/parallax_data.lua")
function OnModInit()
Parallax.registerLayers(10)
Parallax.registerTextures({
"mods/Apotheosis/files/scripts/parallax_backgrounds/textures/parallax_clounds_01.png",
"mods/Apotheosis/files/scripts/parallax_backgrounds/textures/parallax_clounds_02.png",
"mods/Apotheosis/files/scripts/parallax_backgrounds/textures/parallax_mountains_layer_01.png",
"mods/Apotheosis/files/scripts/parallax_backgrounds/textures/parallax_mountains_02.png",
"mods/Apotheosis/files/scripts/parallax_backgrounds/textures/parallax_mountains_layer_02.png",
"mods/Apotheosis/files/scripts/parallax_backgrounds/textures/sky_colors_default.png",
})
end
function OnModPostInit()
Parallax.postInit()
end
function OnWorldPostUpdate()
if InputIsKeyJustDown(39) then demo_mountain() end
if Parallax ~= nil then Parallax.update() end
end
I've been trying to pinpoint the source of the slowdown but so far to no success