Incbin. Help please

BlitzMax Forums/BlitzMax Beginners Area/Incbin. Help please

Amon_old(Posted 2004) [#1]
Getting a few errors with Incbin. I tried a few methods to get it to work but none do. The docs hardly give you a realworld example.

heres the beginning part of my code.

Strict
Incbin "gfx\mrrobota.png"
Graphics 800,600,60



Global mrrobot = LoadAnimImage("incbin::gfx\mrrobota.png",45,64,0,20,MASKEDIMAGE)
SetMaskColor 0,0,0

Global mrframe = 0
Global mrX, mrY, mrS
Global mrH# = 6
Const g# = 0.1
Global timer = MilliSecs()
Global jump = False


mrX = 400
mrY = 300
mrS = 2



Repeat
	
	Cls
	
		DrawImage mrrobot,mrX,mrY,mrframe
		update()
	
	Flip
	
Until KeyHit(KEY_ESCAPE)


it gives me this error.

Unhandled Exception: Attempt to access field or method of Null objectDrawImage [C:\Applications\Coding\BlitzMaxWinBeta\mod\brl.mod\max2d.mod/max2d.bmx;260;2]
main [d:\coding folder\blitzmax\mrrobot/main.bmx;28;3]



Craig Watson(Posted 2004) [#2]
Maybe a long shot, but try to flip those backslashes in the path to forward slashes.

Incbin "gfx/mrrobota.png"
Graphics 800,600,60



Global mrrobot = LoadAnimImage("incbin::gfx/mrrobota.png",45,64,0,20,MASKEDIMAGE)



Amon_old(Posted 2004) [#3]
That fixed it.

Thx Craig. :)


Hotcakes(Posted 2004) [#4]
Forward slashes only. Good to know.