Page 1 of 1

[Solved] Problems during the rotation of an image

PostPosted: Sun Feb 13, 2011 2:37 pm
by ian130mx
Hello,

I'm trying to rotate an image with the Surface#rotozoom method. Actually it is working, the picture rotates as I want, but the problem is that when it rotates the background around the picture "disappear" to let the place to a black square...
Here is what happen when the rotation is applied :
Image

And here is the normal position :
Image

Can you help me to fix that problem ?
Here is the code where I apply the rotation:

Code: Select all
   def spin
      center = @rect.center
      @rotate += 10
      @image = @original.rotozoom(@rotate,1,true)
      @rect.size=[100,100]
      @rect = @image.make_rect()
      @rect.center = center
      if @rotate >= 360
         @image = @original
         @rotate = 0
      end
   end

Re: Problems during the rotation of an image

PostPosted: Tue Feb 15, 2011 4:21 pm
by ian130mx
Oh it's okay, I found what the problem was...

In the initialization of my surface which was containing the image to spin I had this line that was making my background black...

Code: Select all
@original.set_colorkey( @original.get_at([0,0]) )


So I removed it and it's ok now, sorry for my useless post!