Correct Rotation

BlitzMax Forums/BlitzMax Programming/Correct Rotation

TartanTangerine (was Indiepath)(Posted 2005) [#1]
I have built a simple particle engine in Max2D which utilises LoadAnimImage to load a strip of different particle graphics.

I draw the image like this :-

Method Draw()
   SetBlend(LIGHTBLEND)
   SetAlpha(Self.Alpha)
   SetRotation(Self.angle)
   DrawImageRect(ParticleImage,self.x,self.y,self.size,self.size,self.frame)
   SetHandle(0,0)
   SetAlpha(1)
End Method


The issue is that I can not get the images to rotate around the correct axis. I've tried AutoMidHandle and SetHandle and all manner of things but the results, whilst the look kinda cool, are not what I am after.

The AnimImage consists of 4 images of 128x128.

Please help.


SoggyP(Posted 2005) [#2]
Hello.

Have you tried seeting the handle before rotation?

Goodbye.


TartanTangerine (was Indiepath)(Posted 2005) [#3]
Hi, yeah. I'm sure I'm missing something here. It works fine with a single image but as soon as I try AnimImage is goes wrong.


TartanTangerine (was Indiepath)(Posted 2005) [#4]
Fixed it.

I had to set the Handle according to the size of the image when drawn and not the original size.

Doh.