Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Recursively extracting sprites
#5
@TerryRitchie I don't know if you picked a good sheet to illustrate problem?

I had no problem blocking it out from the pixel dimensions given in file properties:
Code: (Select All)
' Terry's sprite sheet demon.png is 781 X 360
' there are 11 images across 781 / 11 = 71 exactly
' thereare 6 images down 360 / 6 = 60
' Hence each image should be 71 X 60

' Let's check that!

Screen _NewImage(800, 600, 32)
_ScreenMove 240, 70

D& = _LoadImage("demon.png", 32)
_PutImage (0, 0), D&, 0 ' OK (finally?)

'For x = 0 To 780 Step 71
'    Line (x, 0)-(x, 359),
'Next
'For y = 0 To 359 Step 60
'    Line (0, y)-(780, y)
'Next
' looks good
Sleep
Dim i&(0 To 57)
For j = 0 To 57
    col = j Mod 11
    row = Int(j / 11)
    i&(j) = _NewImage(71, 60, 32)
    _PutImage , 0, i&(j), (col * 71, row * 60)-Step(70, 59)
Next
'Cls
For j = 0 To 57
    Cls
    _PutImage (0, 0), i&(j), 0
    _PrintString (22, 70), Str$(j)
    Sleep
Next
b = b + ...
Reply


Messages In This Thread
Recursively extracting sprites - by TerryRitchie - 03-03-2024, 05:56 AM
RE: Recursively extracting sprites - by Pete - 03-03-2024, 07:45 AM
RE: Recursively extracting sprites - by GareBear - 03-03-2024, 03:21 PM
RE: Recursively extracting sprites - by Pete - 03-03-2024, 06:09 PM
RE: Recursively extracting sprites - by bplus - 03-03-2024, 07:43 PM
RE: Recursively extracting sprites - by Pete - 03-03-2024, 08:18 PM
RE: Recursively extracting sprites - by Pete - 03-03-2024, 10:03 PM
RE: Recursively extracting sprites - by bplus - 03-04-2024, 12:21 AM



Users browsing this thread: 4 Guest(s)