yeah cheers. I think I got confused with values because I copied the page from one of the other wiki pages & forgot to edit the values properly. - I often do that to save time on having to type everything out again.Corrected now. :)startTween is used to control & access the shader settings... I assume that code is internal in the engine source code.You can actually manipulate data structure objects with startTweenObject function.here's a few examples...[code]-- 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)[/code]here's some example script SimonS wrote - I'm not 100% sure what it does but it applies some kind of overlay over the screen. You need to understand openGL ES 2.0 code to understand/write scripts like this though I think. I had a little look into it but I found it hard to find any simple examples/explanations to point me in the right direction.[code]shader = {_temporary_=0, num = shaderCompile([[#ifdef GL_ESprecision lowp float; precision lowp int; #endifvarying 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_ESprecision highp float; precision lowp int; #endifuniform 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)[/code]In regards to startTween(), have you actually looked over the [url=http://wiki.visionaire-tracker.net/wiki/Shader_(CMS)]shader toolkit[/url] script?Here's a few simple functions I added to the script SimonS wrote.[code]-- * 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) endend-- * 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[/code]...as you can see I am triggering the openGL functions via the startTween function which contains a command & the relevant data for manipulating the screen/camera/object.
by afrlme, 11 years ago