1
Graphics / How can I resize my view when my window size changes but...
« on: February 16, 2009, 07:16:42 pm »
Anybody have any clues about this...?
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Dim cameraX As Single = m_renderWindow.CurrentView.Center.X
Dim cameraY As Single = m_renderWindow.CurrentView.Center.Y
m_renderWindow.CurrentView.SetFromRect(New FloatRect(pnlRenderWindow.ClientRectangle.Left, pnlRenderWindow.ClientRectangle.Top, pnlRenderWindow.ClientRectangle.Right, pnlRenderWindow.ClientRectangle.Bottom))
m_renderWindow.CurrentView.Center = New Vector2(cameraX, cameraY)
' Define points
Dim p1 As Vector2 = New Vector2(0, 0)
Dim p2 As Vector2 = New Vector2(11, 10)
' Create and draw the line
Dim line As SFML.Graphics.Shape = SFML.Graphics.Shape.Line(p1, p2, 1, White)
m_renderWindow.Draw(line)
' Create and draw the sprite
Dim sprite As Sprite = New Sprite(New Image("tiles\1x1.bmp"))
sprite.Position = p2
m_renderWindow.Draw(sprite)