[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] what is the use of Rect.move(offsetX, offsetY) for moving an image?



you mean by manipulating Rect.x  etc?  yep that works fine and that's
how i handle the problem.

but why have the move() method in pygame at all? i mean, what do
people use it for typically?


On 9/5/15, bw <stabbingfinger@xxxxxxxxx> wrote:
> You are correct, sir. The Rect methods convert your inputs to int, at
> which point precision is lost. If we want finer spatial calculations we
> must keep them in forms that don't lose precision, and apply them to the
> Rect object as needed.
>
> On 9/5/2015 2:52 PM, tom arnall wrote:
>> The docs say the Rect.move() can take only integers for the offset
>> parameters. My experiments seem to verify that. This means that it can
>> move an object in only a few directions, i.e., 1,0 for 0 degrees, 1,1
>> for 45 degrees etc. You can of course increase the magnitudes of the
>> offsets and get more angles, but then it is impossible to create the
>> effect of smooth movement.
>>
>> My take anyway. Am I missing something?
>
>


-- 
.....
âOnce you can accept the universe as matter expanding into nothing
that is something, wearing stripes with plaid comes easy.â Albert
Einstein

.....
âI have no special talents, only a passionate and stubborn curiosity.â
Albert Einstein