- Home /
Something like basic READ and DATA commands?
I want to hard code some AnimationCurves. At the moment I'm doing the following:
var ks : Keyframe[] = new Keyframe[3];
ks[0] = Keyframe(0,0);
ks[1] = Keyframe(1,2);
ks[2] = Keyframe(2,7);
var anim : AnimationCurve = new AnimationCurve(ks);
... [etc]
I'd rather do something like this, which used to be possible in Spectrum Basic :-)
var anims = 6; var ks : Keyframe[]; var anim : AnimationCurve[]; anim = new AnimationCurve(anims);
for (var a=0;a<anims;a++) { var numkeys = <READ_INT>; // number of keys in this anim ks = new Keyframe[numkeys]; for (var k=0;k<numkeys;k++) { var t = <READ_FLOAT>; // time var v = <READ_FLOAT>; // value numkeys[k] = Keyframe( t, v ); } anim[a] = new AnimationCurve(ks); }
Data 3 Data 0,0 Data 1,2 Data 2,7
Data 2 Data 0,0 Data 1,5
Data 4 Data 0,1 Data 1,0 Data 2,3 Data 3,-9 ... [etc]
I want to be able to do it within the same js file, rather than parse a separate txt file, as this is for iPhone.
Your answer
Follow this Question
Related Questions
Read data from Websites... 1 Answer
Reading data from one script to another 0 Answers
Reading XML Data C# 2 Answers
Animation data for non mesh purposes 1 Answer