How can I set blur effect from c++ code in corona enterprise?
// this two string works fine
lua_pushstring(hL, “filter.blurGaussian”);
lua_setfield(hL, -2, “effect”);
// This code has no effect
lua_newtable(hL);
lua_pushnumber(hL, 100);
lua_setfield(hL, -2, “blurSize”);
lua_pushnumber(hL, fData->blurX * 10);
lua_setfield(hL, -2, “sigma”);
lua_setfield(hL, -2, “horizontal”);
lua_newtable(hL);
lua_pushnumber(hL, 100);
lua_setfield(hL, -2, “blurSize”);
lua_pushnumber(hL, fData->blurY * 10);
lua_setfield(hL, -2, “sigma”);
lua_setfield(hL, -2, “vertical”);
If I call this lua function from c++ everything works fine but too slow
gaf.setBlur = function(sprite, x, y)
if x == 0 then
x = 0.01
end
if y == 0 then
y = 0.01
end
sprite.fill.effect = “filter.blurGaussian”
sprite.fill.effect.horizontal.blurSize = 100
sprite.fill.effect.vertical.blurSize = 100
sprite.fill.effect.horizontal.sigma = x * 10
sprite.fill.effect.vertical.sigma = y * 10
end