HI,
Not sure if you mean native or hybrid
The first parametet should be the type ("bounce" etc)
native requires a function for callback (or null)
the duration is milliseconds (1000 is one second).
Regards, ah
Native
var list = ""
+"BounceLeft,BounceRight,BounceTop,BounceRight,"
+"FadeIn,FadeOut,"
+"FlipFromLeft,FlipFromRight,FlipFromTop,FlipFromBottom,"
//+"FlipToLeft,FlipToRight,FlipToTop,FlipToBottom,"
+"ScaleFromLeft,ScaleFromRight,ScaleFromTop,ScaleFromBottom,"
+"ScaleToLeft,ScaleToRight,ScaleToTop,ScaleToBottom,"
+"ShakeHorizontal,ShakeVertical,"
+"SlideFromLeft,SlideFromRight,SlideFromTop,SlideFromBottom,"
+"SlideToLeft,SlideToRight,SlideToTop,SlideToBottom,"
+"ZoomInEnter,ZoomOutExit,"
+"ZoomInLeft,ZoomInRight,ZoomInTop,ZoomInBottom,"
+"ZoomOutLeft,ZoomOutRight,ZoomOutTop,ZoomOutBottom,"
+"NewsPaper,Jelly,Flash,RubberBand,Swing,TaDa,Fall,FallRotate"
function OnStart() {
lay = app.CreateLayout( "Linear", "Top,FillXY" )
ddn = app.AddSpinner( lay ,list)
ddn.SetOnChange( function(item,index) {txt.Animate(item,null,1000)} )
ddn.SetPadding(0,0,0,0)
// ddn.SetTextSize( 14 )
txt = app.AddText( lay,"Hello" )
txt.SetTextSize( 32 )
app.AddLayout( lay )
}
Hybrid
export class Main extends App {
onStart() {
this.main = ui.addLayout( "main", "Linear", "vcenter", 1, 1 )
var list = ["Choose an animation","bounce","flash","pulse","rubberBand","shakeX","shakeY","headShake","swing","tada","wobble","jello","heartBeat",
"backInDown","backInLeft","backInRight","backInUp",
"backOutDown","backOutLeft","backOutRight","backOutUp",
"bounceIn","bounceInDown","bounceInLeft","bounceInRight","bounceInUp",
"bounceOut","bounceOutDown","bounceOutLeft","bounceOutRight","bounceOutUp",
"fadeIn","fadeInDown","fadeInDownBig","fadeInLeft","fadeInLeftBig","fadeInRight","fadeInRightBig","fadeInUp","fadeInUpBig","fadeInTopLeft","fadeInTopRight","fadeInBottomLeft","fadeInBottomRight",
"fadeOut","fadeOutDown","fadeOutDownBig","fadeOutLeft","fadeOutLeftBig","fadeOutRight","fadeOutRightBig","fadeOutUp","fadeOutUpBig","fadeOutTopLeft","fadeOutTopRight","fadeOutBottomRight","fadeOutBottomLeft",
"flip","flipInX","flipInY","flipOutX","flipOutY",
"lightSpeedInRight","lightSpeedInLeft","lightSpeedOutRight","lightSpeedOutLeft",
"rotateIn","rotateInDownLeft","rotateInDownRight","rotateInUpLeft","rotateInUpRight",
"rotateOut","rotateOutDownLeft","rotateOutDownRight","rotateOutUpLeft","rotateOutUpRight",
"hinge","jackInTheBox","rollIn","rollOut",
"zoomIn","zoomInDown","zoomInLeft","zoomInRight","zoomInUp",
"zoomOut","zoomOutDown","zoomOutLeft","zoomOutRight","zoomOutUp",
"slideInDown","slideInLeft","slideInRight","slideInUp",
"slideOutDown","slideOutLeft","slideOutRight","slideOutUp"]
this.lst = ui.addSelect( this.main, list, "", 0.8 )
this.lst.value = 0
this.lst.setOnTouch(function (a,b) {
if (b !=0)
img.animate( a,2000 )
}) // ontouch
var img = ui.addImage(this.main,"ds:/Sys/Img/Hello.png","",0.25)
// var img = ui.addButton(this.main,"Hello")
} // onstart
} // class