Page 1 of 1

Scaling is not working

Posted: Thu Mar 06, 2014 3:11 pm
by Foz

Code: Select all

#OutputSprite = 0
#tmpSprite = 1

Global GameWidth.i = 320, GameHeight.i = 240, GameSpriteSize.i = 16
Global DisplayWidth.i = 0, DisplayHeight.i = 0

Procedure RenderFrame()
  ClearScreen($000077)
  
  ClipSprite(#tmpSprite, 20 , 20 , 56 , 52 )
  DisplaySprite(#tmpSprite, 20, 20 )
  
  
  FlipBuffers()
  
EndProcedure


ExamineDesktops()
DisplayWidth = DesktopWidth(0) / 2
DisplayHeight = DesktopHeight(0) /2

OpenWindow (0, 0, 0, DisplayWidth, DisplayHeight, "", #PB_Window_ScreenCentered | #PB_Window_BorderLess)
OpenWindowedScreen(WindowID(0), 0, 0, GameWidth, GameHeight, 1, 0, 0) ; auto scale is set, not not working

SetFrameRate(3)

BindEvent(#PB_Event_RenderFrame, @RenderFrame())

CreateSprite(#tmpSprite, 32, 32)
StartDrawing(SpriteOutput(#tmpSprite))
Box(0, 0, 32, 32, RGB(255,255,255))
StopDrawing()

FlipBuffers(); // start the rendering

Re: Scaling is not working

Posted: Tue Feb 09, 2016 1:23 pm
by Fred
Everything seems OK here, can someone else confirm ? BTW, you can't clip a sprite above it own width/height.