Page 1 of 1

ZoomSprite with negative values

Posted: Tue Dec 10, 2019 6:44 am
by DjPoke
Hello,

I dont know if it is a bug, but i post here, because it can be the case.
With P.B, ZoomSprite with negatives values is used to flip a sprite.

Here is the bug i think i've found in S.B :

Code: Select all

; LoadSprite(1, "mySprite.png") ; load first a 32x32 sprite, drawn on the screen every 30fps in the render callback

; next is a part of a procedure, called at each render callback :
ZoomSprite(1, -32, 32) ; should flip the sprite horizontally
DisplaySprite(1, 100, 100) ; the sprite blink, it alternate flipped and not flipped image
Also, in the last documentation of S.B, in FreeSprite, if think there is a missing word :
"It's not possible to the sprite anymore after calling this function" shoud be something like "It's not possible to use the sprite anymore after calling this function"

EDIT:
I've finally solved this. ZoomSprite with a negative value can only be called one time, at each needed mirror effect. It must not be called in a loop with always negatives values.

Re: ZoomSprite with negative values

Posted: Tue Apr 07, 2020 7:48 am
by Fred
This is not supported, it 'works' only because of luck. We use '-1' as #PB_Default value to reset the sprite dimension, so it will fail with this value.