You're very hard to follow, but here is some code for you.
public class SlotReel
{
private Texture2D ReelTexture;
public int ReelScroll = 0;
public Rectangle Dimensions;
private Viewport reelView;
public SlotReel(Texture2D ReelTex, Rectangle ReelDeminsions)
{
ReelTexture = ReelTex;
Dimensions = ReelDimensions;
reelView = new Viewport(Dimensions.X, Dimensions.Y,
Dimensions.Width, Dimensions.Height);
}
public void Draw(SpriteBatch spriteBatch, GraphicsDevice graphics)
{
Viewport currentViewport = graphics.Viewport;
graphics.Viewport = reelView;
for (int y = ReelScroll; y < Dimensions.Height; y += ReelTexture)
spriteBatch.Draw(ReelTexture, new Rectangle(Dimensions.X,
y, Dimensions.Width, ReelTexture.Height), Color.White);
graphics.Viewport = currentViewport;
}
}
Keep in mind: This code is untested and was done just now in notepad. Please excuse any errors.
You would implement the class like so:
...
Texture2D reelTexture;
public SlotReel reelOne;
...
public void LoadContent()
{
...
reelTexture = Content.Load<Texture2D>("...");
reelOne = new SlotReel(reelTexture, new Rectangle(20,20,30,300));
...
}
...
public void Draw(GameTime gameTime)
{
...
spriteBatch.Begin();
//Draw your background here
...
reelOne.Draw(spriteBatch, GraphicsDevice);
reelOne.reelScroll += (gameTime.ElapsedRealTime.Millisecs / 1000) * 20; //Exchange any value for 20
spriteBatch.End();
...
...
}
...
The [...]s signify where you would insert more code. Note: This was also in notepad, untested.
Hope this helps!
==============================
Don't sweat the petty stuff and don't pet the sweaty stuff.
==============================