ZoomSprite with negative values

Just starting out? Need help? Post your questions and find answers here.
User avatar
DjPoke
Posts: 22
Joined: Sat Dec 19, 2015 5:27 pm
Location: France (Corsica)
Contact:

ZoomSprite with negative values

Post 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.
My Freewares here :
http://retro-bruno.fr/
Fred
Site Admin
Posts: 1510
Joined: Mon Feb 24, 2014 10:51 am

Re: ZoomSprite with negative values

Post 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.
Post Reply