Witam. Piszę pewną prostą grę, dla wprawy (pierwszy raz z XNA :)). Mam takie objekty zdefiniowane w metodzie LoadContent():

sourcerecbuttons[0] = new Rectangle(frames[0] * currentFrames[0], 0, frames[0], texbuttons[0].Height);

sourcerecbuttons[1] = new Rectangle(frames[1] * currentFrames[1], 0, frames[1], texbuttons[1].Height);

sourcerecbuttons[2] = new Rectangle(frames[2] * currentFrames[2], 0, frames[2], texbuttons[2].Height);

destinationrecbuttons[0] = new Rectangle((GraphicsDevice.Viewport.Width - texbuttons[0].Width) / 2, GraphicsDevice.Viewport.Height / 2 - (15 + texbuttons[0].Height + (texbuttons[1].Height / 2)), texbuttons[0].Width, texbuttons[0].Height);

destinationrecbuttons[1] = new Rectangle((GraphicsDevice.Viewport.Width - texbuttons[0].Width) / 2, GraphicsDevice.Viewport.Height / 2 - (texbuttons[1].Height / 2), texbuttons[1].Width, texbuttons[1].Height);

destinationrecbuttons[2] = new Rectangle((GraphicsDevice.Viewport.Width - texbuttons[0].Width) / 2, GraphicsDevice.Viewport.Height / 2 + (texbuttons[2].Height / 2) + 15, texbuttons[2].Width, texbuttons[2].Height);
           

Tablica sourcerecbuttons zawiera pozycje danej klatki w pliku graficznym. Tablica currentFrame zawiera numery aktualnych klatek. W metodzie Update() są one aktualizowane:

            for (int i = 0; i < currentFrames.Length; i++)
            {
                currentFrames[i] = ++currentFrames[i] % FRAMES;
            }

Jednak gdy wszystko renderuję:

            spriteBatch.DrawString(font, currentFrames[0] + "|" + currentFrames[1] + "|" + currentFrames[2], new Vector2(100, 100), Color.White);

            spriteBatch.Draw(texbuttons[0], destinationrecbuttons[0], sourcerecbuttons[0], Color.White);

            spriteBatch.Draw(texbuttons[1], destinationrecbuttons[1], sourcerecbuttons[1], Color.White);

            spriteBatch.Draw(texbuttons[2], destinationrecbuttons[2], sourcerecbuttons[2], Color.White);

            spriteBatch.Draw(texbuttons[3], cursorvecposition, destinationrecbuttons[3], Color.White);

Na ekranie nie widać, żeby się klatki nie zmieniały. Dzięki metodzie DrawString() wiem, że zmienne z tablicy currentFrame się aktualizują, więc chyba gdy mam zdefiniowane to:

sourcerecbuttons[0] = new Rectangle(frames[0] * currentFrames[0], 0, frames[0], texbuttons[0].Height);

sourcerecbuttons[1] = new Rectangle(frames[1] * currentFrames[1], 0, frames[1], texbuttons[1].Height);

sourcerecbuttons[2] = new Rectangle(frames[2] * currentFrames[2], 0, frames[2], texbuttons[2].Height);

To jednak pierwszy argument po zdeklarowaniu obiektu nie aktualizuje się "w praniu", przy czym klatka się nie zmienia. Wie ktoś może jak temu zaradzić? Pozdrawiam.