-- 1. fade scene brightness (current scene) to 100% over 3s with easeLinearIn easing...
startObjectTween(game:getLink(VGameCurrentScene), VSceneBrightness, game:getLink(VGameCurrentScene):getInt(VSceneBrightness), 100, 3000, easeLinearIn)
-- 2. same as above but with direct link to scene & fade down to 25%...
startObjectTween(getObject("Scenes[scn001_cell]"), VSceneBrightness, getObject("Scenes[scn001_cell]"):getInt(VSceneBrightness), 25, 3000, easeLinearOut)
-- 3. smooth camera scrolling from current position to another...
startObjectTween(game,VGameScrollPosition,game:getPoint(VGameScrollPosition),{x=100,y=0},3000,easeBackInOut)
shader = {_temporary_=0, num = shaderCompile([[#ifdef GL_ES
precision lowp float;
precision lowp int;
#endif
varying vec2 texcoord;
uniform mat4 mvp_mat;
attribute vec2 position;
attribute vec2 uv;
uniform int pass;
void main ()
{
gl_Position = mvp_mat * vec4(position.x,position.y,0.0,1.0);
texcoord = uv;
}]],[[#ifdef GL_ES
precision highp float;
precision lowp int;
#endif
uniform sampler2D composite;
uniform int pass;
varying vec2 texcoord;
void main() {
vec2 m = vec2(0.5, 0.5);
float d = distance(m, texcoord) * 1.0;
vec3 c = texture2D(composite, texcoord).rgb * (1.0 - d * d);
gl_FragColor = vec4(c.rgb, 1.0);
}
]])}
shaderSetOptions("active",shader.num)
-- * allows you to pan the camera left or right * --
function shaderPan(offset, delay, easing, axis)
if axis then startTween("shader_offsety", shader_offsety, offset, delay, easing) else startTween("shader_offsetx", shader_offsetx, offset, delay,easing) end
end
-- * allows you to zoom the camera in or out * --
function shaderZoom(zoom, delay, easing)
startTween("shader_scale", shader_scale, zoom, delay, easing)
end
-- * allows you to rotate the screen (w/ degree instead of pi) * --
function shaderRotate(degree, delay, easing)
degree = (degree / 360 * 2 * 3.14) -- convert degree to pi
startTween("shader_rotate", shader_rotate, degree, delay, easing)
end
shaderFollowCharacter("", 2, 3000)
3 sec pause
shaderStopFollow()
shaderViewport(1, 0, 0, 0, 3000, easeQuintOut)
shaderFollowCharacter("", 2, 3000)
3 sec pause
shaderStopFollow()
shaderViewport(1, 0, 0, 0, 2000, easeQuintOut)
Try adding a 1-10ms pause between stopFollow & viewport.