Accesing sprite information

Previous topic - Next topic

pinete

Hi all,
I was wondering if there is a way in which you I could access to x or y current screen coordinates of a sprite at screen, all of this without handling different structures or types beyond GLbasic gives you, I mean, to access directly througn a function or something similar.. :)
thanks in advance!

Slydog

I'm not sure exactly what you are asking, but I think you want to know the x,y location of a sprite (and maybe other attributes).
The problem is that sprites aren't traditional sprites from other platforms.
A sprite only refers to a bitmap, not an actual object on the screen.
The DRAWSPRITE command draws that sprite bitmap to the screen, but the sprite isn't really located at the location.
So, the DRAWSRITE command is more of a BITBLT command.
You manually handle the location using your own variables (or TYPE structure).

To make it more clear of what a sprite is, you can draw a sprite more than once during the same screen frame.
Say you had a bullet sprite defined, you can draw that exact same bullet 100 times on the screen at 100 different locations, all in the same frame.
So where is the bullet sprite?  At 100 different locations.  You can't just query the sprite location as a sprite doesn't have a location in its definition.

I hope I understood your question, or I just gave you a ton of info you may have already known! ha.
My current project (WIP) :: TwistedMaze <<  [Updated: 2015-11-25]

pinete

Thanks Slydog,
indeed, that was my question, you understood it greatly.
Thanks so much for all the provided information ;)
regards!