コード例 #1
0
        private void init(AsVector <AsTexture> textures, float fps)
        {
            if (fps <= 0)
            {
                throw new AsArgumentError("Invalid fps: " + fps);
            }
            int numFrames = (int)(textures.getLength());

            mDefaultFrameDuration = 1.0f / fps;
            mLoop         = true;
            mPlaying      = true;
            mCurrentTime  = 0.0f;
            mCurrentFrame = 0;
            mTotalTime    = mDefaultFrameDuration * numFrames;
            mTextures     = textures.concat();
            mSounds       = new AsVector <AsSound>(numFrames);
            mDurations    = new AsVector <float>(numFrames);
            mStartTimes   = new AsVector <float>(numFrames);
            int i = 0;

            for (; i < numFrames; ++i)
            {
                mDurations[i]  = mDefaultFrameDuration;
                mStartTimes[i] = i * mDefaultFrameDuration;
            }
        }
コード例 #2
0
 public virtual AsVector <AsTouch> getTouches()
 {
     return(mTouches.concat());
 }
コード例 #3
0
 private void init(AsVector<AsTexture> textures, float fps)
 {
     if(fps <= 0)
     {
         throw new AsArgumentError("Invalid fps: " + fps);
     }
     int numFrames = (int)(textures.getLength());
     mDefaultFrameDuration = 1.0f / fps;
     mLoop = true;
     mPlaying = true;
     mCurrentTime = 0.0f;
     mCurrentFrame = 0;
     mTotalTime = mDefaultFrameDuration * numFrames;
     mTextures = textures.concat();
     mSounds = new AsVector<AsSound>(numFrames);
     mDurations = new AsVector<float>(numFrames);
     mStartTimes = new AsVector<float>(numFrames);
     int i = 0;
     for (; i < numFrames; ++i)
     {
         mDurations[i] = mDefaultFrameDuration;
         mStartTimes[i] = i * mDefaultFrameDuration;
     }
 }