Welcome to Phrogram Sign in | Join | Help


Bug Report: Rotation loses sprite centre

  •  11-23-2006, 9:21 AM

    Bug Report: Rotation loses sprite centre

    (I don't know if there's somewhere else you want bug reports to be filed --- a new forum group perhaps?)

    There seems to be a bug with rotating sprites such that, once rotated, Phrogram loses track of where the centre of the sprite is. In particular, once you've rotated it, a call to CenterAt seems to result in the wrong placement. The short program below demonstrates this.

    Neil 

    Program RotateBug 

          Method Main()

                Define p As Pen
                p.Color = Colors.Black
                p.MoveTo(100, 0)
                p.DrawTo(100, 100)
                p.DrawTo(0, 100)

                p.MoveTo(200, 0)
                p.DrawTo(200, 200)
                p.DrawTo(0, 200)

                Define s As Sprite
                s.Load(
    "Car1.gif")
                s.CenterAt(100, 100)
                s.Show()
                PrintLine(
    "Sprite centred at (100, 100)")

                Delay(3000)
                s.Rotation = 90
                PrintLine(
    "Sprite rotated by 90 degrees")

                Delay(3000)
                s.CenterAt(200, 200)
                PrintLine(
    "Sprite centred at (200, 200)")

          End Method 

    End Program

     

     

    Filed under: ,
View Complete Thread