Hi, I dont understand whats going on while using method compare.
In short:
I put Image instances in the imagelist
Draw images in imagelist on screen
Call "Method collide"
Works, i click on that images on screen and they get removed.
The Problem:
It only works if i dont have "Method compare" in my Type.
With "Method compare" in Type Image:
Imagescollide gets true but it doesnt listremove the images i have clicked on (but removes other images).
I dont even call "method compare" by myself.
And shouldnt it just return the int value of "muh-s.muh"?
If "Method compare" would mix up some fields or Imagelist, why everything is drawn correctly on screen (loops through imagelist and draws them)?
Any compare gurus out there?
type Test
field imagelist:tlist=new TList
end type
type Image
Field Bitmap
Field X=random
Field Y=random
Field muh
Method compare(obj:Object)
Local t:tile = tile(obj)
If t=null Then Return 1
Return muh - t.muh
End Method
End Type
Method collide
For i:image=eachin Test.imagelist
if imagescollide (mousecursor, i) then
ListRemove test.list, i;
endif
next
end method
In short:
I put Image instances in the imagelist
Draw images in imagelist on screen
Call "Method collide"
Works, i click on that images on screen and they get removed.
The Problem:
It only works if i dont have "Method compare" in my Type.
With "Method compare" in Type Image:
Imagescollide gets true but it doesnt listremove the images i have clicked on (but removes other images).
I dont even call "method compare" by myself.
And shouldnt it just return the int value of "muh-s.muh"?
If "Method compare" would mix up some fields or Imagelist, why everything is drawn correctly on screen (loops through imagelist and draws them)?
Any compare gurus out there?
type Test
field imagelist:tlist=new TList
end type
type Image
Field Bitmap
Field X=random
Field Y=random
Field muh
Method compare(obj:Object)
Local t:tile = tile(obj)
If t=null Then Return 1
Return muh - t.muh
End Method
End Type
Method collide
For i:image=eachin Test.imagelist
if imagescollide (mousecursor, i) then
ListRemove test.list, i;
endif
next
end method