LoginLogin
Might make SBS readonly: thread

How to SPSCALE Shrink sprites

Root / FAQs / [.]

legofordmnCreated:
How do you shrink sprites?

Set the scale factor to something less than 1.
SPSCALE ID,0.5,0.5 'sprite is half as wide and half as tall

How would I make a code where if I pushed up on the d-pad , it would make a Sprite larger and larger, and if I hit down on the d-pad it would continuously shrink a Sprite?

How would I make a code where if I pushed up on the d-pad , it would make a Sprite larger and larger, and if I hit down on the d-pad it would continuously shrink a Sprite?
SPSET 0,413 '🐠
SCALE# = 2.0 'Start at double size.

WHILE 1 'Forever:
 VSYNC 'Wait a frame.
 IF BUTTON()==#UP   && SCALE#< 32 THEN:INC SCALE#,0.1 'If UP is pressed, and the scale is not too high, then increase scale.
 IF BUTTON()==#DOWN && SCALE#>0.1 THEN:DEC SCALE#,0.1 'If DOWN is pressed, and the scale is not too low, then decrease scale.
 SPSCALE 0,SCALE#,SCALE# 'Apply scale to sprite.
 'Note that a scale of zero or lower results in an error.
WEND