I have requested this, very long ago... what do you think about something like:
HandleSprite(SpriteID,X,Y)
MidHandleSprite(SpriteID)
So your sprites are not ever handled at 0,0 !! Changing the Handle would be nice for some stuff like rotating around the centre (MidHandle) of a Sprite or Image!
One more command for Sprites
One more command for Sprites
va!n aka Thorsten
Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
Fou-Lu wrote:I don't think it's absolutely necessary, but it would be good. I've already seen that in darkbasic, it was called spriteoffset. When you say SpriteID, you mean the number of the sprite, right?
yes, SpriteID should be SpriteNumber

I think a command like this would be very usefull, even if you have a sprite object with a size of 80x80 for example and want rotate it around position 40,40 instead at 0,0!

va!n aka Thorsten
Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
- Fou-Lu
- Enthusiast
- Posts: 201
- Joined: Tue Jul 12, 2005 8:30 am
- Location: I'm pretty sure this is all a nightmare
- Contact:
TransformSprite3D() can change the handle of a sprite3D.You could create a procedure to rotate a sprite3D in the middle:
Is this what you want?
Anyway, I think there could be a feature like that.
Code: Select all
initsprite()
initsprite3d()
initmouse()
openscreen(640,480,32,"")
Procedure Mid_Rotate_Sprite3D(sprite.l,angle.f,size.f)
x1=cos(angle-2.3561944)*size*0.707106
y1=sin(angle-2.3561944)*size*0.707106
x2=-y1
y2=x1
x3=-x1
y3=-y1
x4=-x2
y4=-y2
TransformSprite3D(sprite,x1,y1,x2,y2,x3,y3,x4,y4)
endprocedure
createsprite(1,64,64,#pb_sprite_texture)
startdrawing(spriteoutput(1))
for gy=0 to 63
for gx=0 to 63
plot(gx,gy,gx*4+(gy*4<<16))
next gx
next gy
stopdrawing()
createsprite3d(1,1)
repeat
rot.f=rot+0.1
clearscreen(0,0,0)
start3d()
mid_rotate_sprite3d(1,rot,64)
displaysprite3d(1,mousex(),mousey(),255)
stop3d()
flipbuffers()
examinemouse()
until mousebutton(1)
Anyway, I think there could be a feature like that.
yes,thats what i mean! didnt noticed that it still exist! thanksFou-Lu wrote:TransformSprite3D() can change the handle of a sprite3D.You could create a procedure to rotate a sprite3D in the middle:
Is this what you want?
Anyway, I think there could be a feature like that.

va!n aka Thorsten
Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,