Yikes both forumlas were flawed, glad I checked my formulas. Turns out we only need SPR's Sprites per Row:
sheetx = (index Mod SPRow) * SW
sheety = Int(index / SPRow) * SH
OK here is snap of the sprite sheet:
We will display the top row of cards by index numbers from 0 to 13
Change index = 14 to 27 and see the next row... 28 to 41 next and 42 to 55 for last.
zip with card sheet and code:
sheetx = (index Mod SPRow) * SW
sheety = Int(index / SPRow) * SH
OK here is snap of the sprite sheet:
We will display the top row of cards by index numbers from 0 to 13
Code: (Select All)
_Title "Card Sprites by Index demo" 'bplus 2025-11-27
CardDeck = _LoadImage("Cards.png")
If CardDeck = -1 Then Print "Cards.png failed to load, bye!": End
' this set
SW = 72: SH = 96: SPRow = 14: SPCol = 4
Screen _NewImage(3 * SW, 3 * SH, 32) ' magnify each card 3X's its pixel size
For index = 0 To 13
Cls
sheetx = (index Mod SPRow) * SW
sheety = Int(index / SPRow) * SH
_PutImage , CardDeck, 0, (sheetx, sheety)-Step(SW, SH)
_Delay .5
NextChange index = 14 to 27 and see the next row... 28 to 41 next and 42 to 55 for last.
zip with card sheet and code:
724 855 599 923 575 468 400 206 147 564 878 823 652 556 bxor cross forever

