SpriteScaleFactor backgroundsprite, 0.50
This should scale my sprite by 50%, but the sprite doesn't change size.
You have to set the sprite mode to one of the scaled modes. @TRANSSCALED for example. Users guide for 2D->Sprites. And before you ask they are software rendered so you can't combine modes, you can only use the ones from that chart.
This shifts the sprite, I even tried @Scaled, but as I reduce the sprite in size, it shifts id down on the screen.
Here is my code:
backgroundsprite = LoadSprite(GETSTARTPATH + "img\background.bmp")
if backgroundsprite <> NULL
SpriteDrawMode backgroundsprite, @SCALED
SpriteScaleFactor backgroundsprite, 0.95
Frame = 0
int mElapsed,mTimer
mTimer = timeGetTime()
exit_game=FALSE
/* Our beautiful Game Loop */
DO
FILLSCREEN 0
'ESC to exit at any time
IF KEYDOWN(1) then exit_game = TRUE
SpriteFrame backgroundsprite, 0
DrawSpriteXY backgroundsprite,0,0
'target 75 frames per second for movement.
mElapsed = timeGetTime() - mTimer
mTimer = timeGetTime()
mAdjust = mElapsed / 13.3333
fps = FLIP 1
UNTIL exit_game
FREESPRITE backgroundsprite
ENDIF
CLOSESCREEN
Scaling is based on the center of the sprite. Any more questions?
Yea how do I move the scaled sprite if DrawSpriteXY doesn't move it? I want the scaled version to be placed with upper left at 0,0
DrawSpriteXY sprite, -w/2 * scale, -h/2 * scale
Would be my guess. Either that or just create a bitmap of the correct size in the first place ;)
Takes out half the fun of messing with the methods to see what I can dork up.
I'll let you sleep now :) going to work on this more tomorrow night :) Thanks