Page 1 of 1

SpriteX(#Sprite) & SpriteY(#Sprite)

Posted: Wed Mar 23, 2005 11:31 pm
by nco2k

Code: Select all

SpriteX(#Sprite) ;Get the current X-Position of the Sprite
SpriteY(#Sprite) ;Get the current Y-Position of the Sprite
this might be useful. fred what do you think?

c ya,
nco2k

Posted: Thu Mar 24, 2005 12:21 am
by Hroudtwolf
The problem is, a sprite can be more than once on a screen.

Re: SpriteX(#Sprite) & SpriteY(#Sprite)

Posted: Thu Mar 24, 2005 5:16 pm
by Ralf
nco2k wrote:

Code: Select all

SpriteX(#Sprite) ;Get the current X-Position of the Sprite
SpriteY(#Sprite) ;Get the current Y-Position of the Sprite
this might be useful. fred what do you think?

c ya,
nco2k
i dont know how it should make sence! you create or load a sprite and can get its width and height! then you can move the sprite with variables like x and y! so YOU move the sprite and so you KNOW the position of the sprite!

i think such command absolutely useless, sorry!

there would be a lot other things, that would make more sence, like SetSpriteHandle(sprite,x,y)

Posted: Thu Mar 24, 2005 5:37 pm
by nco2k
@Hroudtwolf
yes you are right. i forgot about that. :shock:

@Ralf
maybe for you, but there are some situations where this command might become pretty handsome.

but this is pointless now, like Hroudtwolf said "The problem is, a sprite can be more than once on a screen."

p.s.: SetSpriteHandle(sprite,x,y) what for?!

c ya,
nco2k

Posted: Thu Mar 24, 2005 6:08 pm
by Hroudtwolf
You can handle sprites easier if you create variable procedures for your sprites.

Code: Select all

Procedure SpiteHandling(spritenumber,xpos,ypos,SpriteMode)
If SpriteMode(spritenumber)=1
DisplaySprite (SpriteFigure(spritenumber),SpriteX(spritenumber),SpriteY(spritenumber))
else 
DisplaySprite (SpriteFigure(spritenumber),SpriteX(spritenumber),SpriteY(spritenumber))
endif 
endprocedure 
Just one example. But that is a easy way to handle with sprites in games.