setRotateAnimation(object, speed, offset, strength, direction, func)
Func - this is the vibration pattern, which can be programmed. garphics.noise and garphics.noise2 are perlin noises and thus are just noises, you can't make them to behave in some intricate manner. If you want something in particular like wind gusts with specific vibration patterns, then there's math involved and some external input, which controls wind strength and this funcion in cooperation.allright... so there are "only" two builtin functions here graphics.noise and graphics.noise2?
function()return getCursorPos().x / game.WindowResolution.x end
Basically you can write any function, even use time, which returns floating value, but I don't know what range is, maybe between 0 and 1.0.function()return getCursorPos().x * 1 / game.WindowResolution.x end
can someone explain, how this script can be used?
setRotateAnimation(Objects["gfx_banner_left_1"], 0.4, 1, 0.1, 2, graphics.noise)
setRotateAnimation(Objects["gfx_banner_left_2"], 0.3, 3, 0.2, 2, graphics.noise)
setRotateAnimation(Objects["gfx_banner_left_3"], 0.4, 5, 0.15, 2, graphics.noise)
-- Rotate Animations
--
-- Examples:
-- setRotateAnimation(Objects["2040_Bush_light_17"], 1.0, 0.3, 0.2, 3, graphics.noise)
-- setRotateAnimation(Objects["2040_Tree_b_light_01"], 1.0, 0.0, 0.2, 3, math.sin)
-- setRotateAnimation(Objects["2040_VG2"], 1.0, 0.0, 0.2, 3, function(a)return math.sin(graphics.noise(a)) end)
--
-- setRotateAnimation(object, speed, offset, strength, direction, func)
-- func can be: function(a)return math.sin(graphics.noise( a )) end
-- setRotateAnimationToStrength(objectnamestring, speed, offset, strengthFrom, strengthTo, direction, function, time) -> smooth Rotation From - To Strength
-- direction/pinned side:
-- 1 - down, 2 - up, 3 - left, 4 - right
--