Now, this is very odd... There's no reason why this should work. It's afunction that creates a new type object, and create a new image and assigns it to a type field:
Function create_new_furniture()
f.furniture = New furniture
Locate 0,0
f\name$ = Input("Name: ")
f\length = Input("Length: ")
f\width = Input("Width: ")
f\x = 400
f\y = 300
f\length = f\length*scale
f\width = f\width*scale
f\rotation = 0
f\image = CreateImage(f\length,f\width)
SetBuffer ImageBuffer(f\image) ; <<<< ERROR!!
Color 200,100,100
Rect 0,0,f\length,f\width
Color 255,255,255
Rect 0,0,f\length,f\width,0
SetBuffer BackBuffer()
MidHandle f\image
f_handle(f_number) = Handle(f.furniture)
End Function
As I have highlighted:
SetBuffer ImageBuffer(f\image) ; <<<< ERROR!!
Produces an image does not exist error. I'm using IBJECT and HANDLE commands to jump to a certain type ojbect, but, that shouldn't matter here, as i'm creating a new object in the function. Anyone got any idea?
|