SpriteX(#Sprite) & SpriteY(#Sprite)

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
nco2k
Addict
Addict
Posts: 1344
Joined: Mon Sep 15, 2003 5:55 am

SpriteX(#Sprite) & SpriteY(#Sprite)

Post 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
User avatar
Hroudtwolf
Addict
Addict
Posts: 803
Joined: Sat Feb 12, 2005 3:35 am
Location: Germany(Hessen)
Contact:

Post by Hroudtwolf »

The problem is, a sprite can be more than once on a screen.
Ralf
Enthusiast
Enthusiast
Posts: 203
Joined: Fri May 30, 2003 1:29 pm
Location: Germany

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

Post 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)
User avatar
nco2k
Addict
Addict
Posts: 1344
Joined: Mon Sep 15, 2003 5:55 am

Post 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
User avatar
Hroudtwolf
Addict
Addict
Posts: 803
Joined: Sat Feb 12, 2005 3:35 am
Location: Germany(Hessen)
Contact:

Post 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.
Post Reply