SpriteControl problems

Blitz3D Forums/Blitz3D Programming/SpriteControl problems

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Hi! This is for users that are familiar with SpriteControl (http://www.blitzbasic.com/codearcs/codearcs.php?code=456) :-)

Include "Sprite Control.bb"
Graphics3D 640,480
SetBuffer BackBuffer()

treasureMapSize = GraphicsHeight() ;based on the graphicsheight, I will also size the map to 
								   ;the screenwidth, since width is always bigger than height.
pieceSize = treasureMapSize / 4

Type kaartstukje
	Field entity
	Field id
End Type


mycamera=CreateCamera()
myspritecam = CreateSpriteCamera()


kaart = LoadImage3D ("kaart.jpg",1)
palen = LoadImage3D ("vb.png",2)

HandleImage3D kaart,-1,-1
DrawImage3D kaart,0,0
ResizeImage3D kaart,treasureMapSize,treasureMapSize 

HandleImage3D palen,-1,-1
DrawImage3D palen,0,0
ResizeImage3D palen,treasureMapSize,treasureMapSize 


RenderWorld
Flip
kaart_id=1

; chop the images in pieces
For y=0 To 3 
	For x=0 To 3  
		k.kaartstukje = New kaartstukje
		k\entity = GrabImage3D(x*pieceSize, y*pieceSize, pieceSize, pieceSize)
		k\id = kaart_id
		kaart_id=kaart_id+1
	Next
Next

; remove the big images, no need for them anymore
FreeEntity kaart
FreeEntity palen

;FlushKeys
;WaitKey

; draw them again
x=0 : y=0
For k.kaartstukje = Each kaartstukje
  	HandleImage3D k\entity,-1,-1	
	DrawImage3D k\entity, x*pieceSize+2, y*pieceSize+2
	x = x + 1 
	If x > 3 
		x = 0
		y = y + 1
		End If
		
Next
RenderWorld
Flip
	

WaitKey
End


Now what this code does: chop two displayed images into 16 pieces, and show them again (draw each chopped piece).
Weird enough piece #7 is also piece #5. And the loop is correct! I checked which coordinates are grabbed, and displayed again, so this shouldn't be possible!
First question: Someone knows what going on?

Second question: it grabs what is displayed on screen, but I do not want the user to see this. I tried hideEntity and cameraProjMode 0 but then the result is that nothing gets grabbed (because it is hidden).
How can I NOT show what's going on but still grab the image?

Thank you!