Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Hollister Man on Fri 26/11/2004 17:57:55

Title: RawDrawImage Offset (compared to Object)
Post by: Hollister Man on Fri 26/11/2004 17:57:55
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.
Title: Re: RawDrawImage Offset (compared to Object)
Post by: Ashen on Fri 26/11/2004 18:50:48
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:

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.
Title: Re: RawDrawImage Offset (compared to Object)
Post by: Hollister Man on Fri 26/11/2004 19:01:16
I'll try that, thank you very much.