max2d_01.bmx 875 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. Rem
  2. This test checks:
  3. - and if loading as animimage works too
  4. End Rem
  5. SuperStrict
  6. Framework BRL.StandardIO
  7. Import Brl.Pixmap
  8. Import Brl.GLMax2D
  9. Graphics 640,480,0
  10. 'create a pixmap
  11. local pix:TPixmap = CreatePixmap(64,64, PF_RGBA8888)
  12. local res:int = TRUE
  13. 'blackout
  14. pix.ClearPixels(0)
  15. For local x:int = 0 until pix.width
  16. For local y:int = 0 until pix.height
  17. pix.WritePixel(x,y, RGBA_Color(255, 3*x,4*y, 2*(x+y)) )
  18. Next
  19. Next
  20. local animImage:TImage = LoadAnimImage(pix,32,32,0,4)
  21. Cls
  22. DrawPixmap(pix, 50,50)
  23. DrawImage(animImage, 150, 50, 0)
  24. DrawImage(animImage, 200, 50, 1)
  25. DrawImage(animImage, 150,100, 2)
  26. DrawImage(animImage, 200,100, 3)
  27. Flip 0
  28. Delay(250)
  29. print "success: "+res
  30. Function RGBA_Color:Int(alpha:int,r:int,g:int,b:int)
  31. Return (Int(alpha * $1000000) + Int(r * $10000) + Int(g * $100) + Int(b))
  32. EndFunction