Skip to content

Instantly share code, notes, and snippets.

@brigand
Created October 24, 2012 01:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brigand/3943198 to your computer and use it in GitHub Desktop.
Save brigand/3943198 to your computer and use it in GitHub Desktop.
#Include <GDIp>
#Include <GDIpHelper>
SetUpGDIP()
AllW := 512
AllH := 512
SpW := AllW / 9
SpH := AllH / 5
SpA := [[1, 1, 1, 1, 1, 1, 1, 1, 1]
, [1, 1, 1, 1, 1, 1, 1, 1, 1]
, [1, 1, 1, 1, 1, 1, 1]
, [1, 1, 1, 1, 1, 1]]
C := 1
R := 1
WMod := 3
HMod := 3
SetTimer, update, 250
update:
StartDrawGDIP()
Gdip_ResetClip(pGraphics)
ClearDrawGDIP()
if (!SpA[R, C])
R += 1, C := 1
if (!SpA[R, C])
C := 1, R := 1
X := 0, Y := 0
Gdip_SetClipRect(G, X, Y, SpW * WMod, SpH * HMod)
pBitmap := Gdip_CreateBitmapFromFile("sprite.png")
Gdip_DrawImage(G, pBitmap
, (X - SpW * (C-1)) * WMod
, (Y - SpH * (R-1)) * HMod
, AllW * WMod, AllH * HMod)
Gdip_DisposeImage(pBitmap)
EndDrawGDIP()
C += 1
return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment