ok so I have found the problem...
since I'm using render to image to do some drawings every loop...
its something like this:
do
RenderToImage(img,0)
// somedrawings...
// rendering 3d
// and then
RenderToScreen()
SetSpriteVisible(spr,1)
DrawSprite(spr)
SetspriteVisible(spr,0)
render()
swap()
and what happens is .. that for some unreasonable reason... the 3d objects are in front of those sprites that use the visible + draw visible - while the other sprites which are always on no matter what does take difference from the SetGlobal3dDepth ..
can someone explain why this is happening ? cause using this system the game run faster... about 100 FPS more.. which is most important when you use RenderToImage.. cause you can manage to draw a lot more..
FIXED FIXED FIXED FIXED !!!!!!!!!!!!!!!!!!!!!!!!!!!!!
ok so as I was writing here I realized something...
when I use to Reshow the 3d objects (again cause of renderToImage...) I did
renderToScreen()
for I = 1 to 100
SetObjectVisible(obj[I],1)
next I
for I = 1 to 100
SetSpriteVisible(spr[I],1)
drawSprite(spr[I])
SetSpriteVisible(spr[I],0)
next I
render()
swap()
for I = 1 to 100
SetObjectVisible(obj[I],0)
next I
to fix it
renderToScreen()
for I = 1 to 100
SetObjectVisible(obj[I],1)
DrawObject(Obj[I])
SetOBjectVisible(obj[I],0)
next I
for I = 1 to 100
SetSpriteVisible(spr[I],1)
drawSprite(spr[I])
SetSpriteVisible(spr[I],0)
next I
render()
swap()
and it is fixed..
so the problem was in my coding.. and I wonder now how I did not noticed it before....
running solid now , everything is good.
thank you.