Beginner , Method Draw Problem

BlitzMax Forums/BlitzMax Beginners Area/Beginner , Method Draw Problem

The Forum Archive is locked. These are the original blitzbasic.com forums, kept so their posts can still be read and searched. No new topics, replies or edits can be made here. To join the conversation, head over to the Blitz3D+ forums.

Hi , i´m new to Bmax !

This Example gives me a bit headache .

When i try to Draw an image with the drawObj() Method, the Program crashes .
It works fine when i draw Text only ....
The Drawimage command is in comment mode now.....

 
Graphics 800,600

Switchknob:Timage = LoadAnimImage ("osc_shape.png",80,38,0,3)

' Class

Type Knob

	Field name: String
	Field x,y :Int
	Field frames:Int

	Method drawObj()
		DrawText "NAME:" + name +" POS " + " X: " + X + " Y: " + Y  + "   FRAMES: "+ Frames, X , Y
		'DrawImage Switchknob,X,Y,Frames
	End Method

End Type

' Objects
Local oscOne:knob = New knob
	
	oscOne.name = " OSC I  "
	oscOne.x = 20 ; oscOne.y = 40
	oscOne.frames = 1
	
Local oscTwo:knob= New knob

	oscTwo.name = " OSC II "  
	oscTwo.x = 20 ; oscTwo.y = 150
	oscTwo.Frames = 0

Local  oscThree:knob = New knob

	oscThree.name = " OSC III  "
	oscThree.x = 20 ; oscThree.y = 200
	oscThree.Frames = 3

Repeat
	

	oscOne.drawObj()
	oscTwo.drawObj()
	oscThree.drawObj()
	
Flip;Cls
Until KeyHit(KEY_ESCAPE)
End