Discuz! Board

 

 

Search
Discuz! Board Forum Find Tutorials Sample Code: simaction
View: 3668|Reply: 2
go

Sample Code: simaction

Rank: 9Rank: 9Rank: 9

Post on 2011-5-5 20:22 |All posts
var p = getscene();   
var l = p.addlabel("quit","Arial",25).pos(400,270);
l.setevent(EVENT_TOUCH,f);
function f(x){quitgame();}

var t1 = p.addlabel("rotateby","Arial",25).anchor(50,50).pos(50,50);
t1.setevent(EVENT_TOUCH,f1);
function f1(x){ x.addaction(rotateby(3000,45)); }

var t2 = p.addlabel("irotateby","Arial",25).anchor(50,50).pos(150,50);
t2.setevent(EVENT_TOUCH,f2);
function f2(x){ x.addaction(irotateby(45)); }

var t3 = p.addlabel("moveby","Arial",25).anchor(50,50).pos(250,50);
t3.setevent(EVENT_TOUCH,f3);
function f3(x){ x.addaction(moveby(3000,50,0)); }

var t4 = p.addlabel("imoveby","Arial",25).anchor(50,50).pos(350,50);
t4.setevent(EVENT_TOUCH,f4);
function f4(x){ x.addaction(imoveby(50,0)); }

var t5 = p.addlabel("scaleto","Arial",25).pos(0,100);
t5.setevent(EVENT_TOUCH,f5);
function f5(x){ x.addaction(scaleto(3000,150,150)); }

var t6 = p.addlabel("fadeout", "Arial",25).pos(100,100);
t6.setevent(EVENT_TOUCH,f6);
function f6(x){ x.addaction(fadeout(3000)); }

var t7 = p.addlabel("trapezeby", "Arial",25).pos(200,100);
t7.setevent(EVENT_TOUCH,f7);
function f7(x){ x.addaction(trapezeby(3000,0,50)); }

var t8 = p.addlabel("delay+move", "Arial",25).pos(0,150);
t8.setevent(EVENT_TOUCH,f8);
function f8(x){ x.addaction(sequence(delaytime(3000),imoveby(50,0))); }

var t9 = p.addlabel("rotate+move", "Arial",25).pos(80,250).anchor(50,50);
t9.setevent(EVENT_TOUCH,f9);
function f9(x){ x.addaction(spawn(moveby(3000,70,0),rotateby(3000,45))); }

Post on 2011-7-13 10:20 |All posts
Tips: The author has been banned or deleted, content has been banned automatically

Rank: 1

Post on 2013-4-13 15:46 |All posts
content has been banned automatically!
Security Q&A Change Security code Change

Archiver|Comsenz Inc.

All time is GMT+8, 2013-6-20 03:48 , Processed in 0.031508 second(s), 10 queries .

Powered by Discuz! X1.5

© 2001-2010 Comsenz Inc.