RawDrawImage Offset (compared to Object)

Started by Hollister Man, Fri 26/11/2004 17:57:55

Previous topic - Next topic

Hollister Man

I always have trouble finding what I'm looking for when I use the search function, so...

Does anyone know the exact 'offset' between where an object (lets say OBJ1) is and where RawDrawImage(GetObjectX(OBJ1), GetObjectY(OBJ1), GetObjectGraphic(OBJ1)) would place the image of it?  I wanted to use MergeObject to 'stamp' the object image, but it locks the object from further manipulation.
That's like looking through a microscope at a bacterial culture and seeing a THOUSAND DANCING HAMSTERS!

Your whole planet is gonna blow up!  Your whole DAMN planet...

Ashen

I think the object co-ordinates are based on the bottom left corner of the object, while the RawDrawImage() co-ords are the top left, so it would be:
Code: ags

RawDrawImage(GetObjectX(OBJ1), GetObjectY(OBJ1) - GetGameParameter(GP_SPRITEHEIGHT, GetObjectGraphic(OBJ1), 0, 0), GetObjectGraphic(OBJ1));


Or something like that. Works for me, but might need some finessing to fit your script, depending on what exactly you want.
I know what you're thinking ... Don't think that.

Hollister Man

That's like looking through a microscope at a bacterial culture and seeing a THOUSAND DANCING HAMSTERS!

Your whole planet is gonna blow up!  Your whole DAMN planet...

SMF spam blocked by CleanTalk