Author Topic: LOADSPRITEMEM() example in Docs  (Read 1454 times)

Offline fuzzy70

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 828
  • Look left, Look right, LOOK OUT!!
    • View Profile
LOADSPRITEMEM() example in Docs
« on: 2012-Mar-03 »
Just a simple change needed to the online help. While trying out this command from the example in the help I kept getting compile errors & after a bit of head scratching figured out the problem.
Code: (glbasic) [Select]
LOCAL w%, h%, pix%[]
IF LOADSPRITEMEM("test.png", w%, h%, pix%[])
   MEM2SPRITE(0, w%, h%, pix%[])
   DRAWSPRITE 0,0,0
ENDIF
SHOWSCREEN
MOUSEWAIT

Just swap the "MEM2SPRITE(0, w%, h%, pix%[])" with "MEM2SPRITE(pix%[],0, w%, h%)" will fix it, might have been a simple typo or the array may have been the last parameter in an older version of GLB.

Lee
"Why don't you just make ten louder and make ten be the top number and make that a little louder?"
- "These go to eleven."

This Is Spinal Tap (1984)

Offline kanonet

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 1137
    • View Profile
    • My GLBasic code archiv
Re: LOADSPRITEMEM() example in Docs
« Reply #1 on: 2012-Mar-04 »
Its also wrong in the German help-file.
Lenovo Thinkpad T430u: Intel i5-3317U, 8GB DDR3, NVidia GeForce 620M, Micron RealSSD C400 @Win7 x64