Fix background & splash scaling
This commit is contained in:
parent
593c5731a1
commit
4e23c9f9da
|
@ -826,8 +826,13 @@ Public Class NewMainMenuScreen
|
|||
backSize.Height = windowSize.Height
|
||||
backSize.Width = CInt(windowSize.Height / origSize.Height * origSize.Width)
|
||||
End If
|
||||
Dim xOffset As Integer = 0
|
||||
If windowSize.Width < backSize.Width Then
|
||||
Dim xAspectRatio As Single = CSng(origSize.Width / backSize.Width)
|
||||
xOffset = CInt(Math.Floor((backSize.Width - windowSize.Width) * xAspectRatio) / 2)
|
||||
End If
|
||||
|
||||
Core.SpriteBatch.Draw(GameModeSplash, New Rectangle(0, 0, backSize.Width, backSize.Height), Color.White)
|
||||
Core.SpriteBatch.Draw(GameModeSplash, New Rectangle(0, 0, backSize.Width, backSize.Height), New Rectangle(xOffset, 0, origSize.Width, origSize.Height), Color.White)
|
||||
End Sub
|
||||
Public Sub DrawGameJoltButtons(ByVal offset As Vector2)
|
||||
Dim r As New Rectangle(CInt(offset.X + 400), CInt(offset.Y + 200), 512, 128)
|
||||
|
@ -1661,8 +1666,13 @@ Public Class GameModeSelectionScreen
|
|||
backSize.Height = windowSize.Height
|
||||
backSize.Width = CInt(windowSize.Height / origSize.Height * origSize.Width)
|
||||
End If
|
||||
Dim xOffset As Integer = 0
|
||||
If windowSize.Width < backSize.Width Then
|
||||
Dim xAspectRatio As Single = CSng(origSize.Width / backSize.Width)
|
||||
xOffset = CInt(Math.Floor((backSize.Width - windowSize.Width) * xAspectRatio) / 2)
|
||||
End If
|
||||
|
||||
Core.SpriteBatch.Draw(GameModeSplash, New Rectangle(0, 0, backSize.Width, backSize.Height), Color.White)
|
||||
Core.SpriteBatch.Draw(GameModeSplash, New Rectangle(0, 0, backSize.Width, backSize.Height), New Rectangle(xOffset, 0, origSize.Width, origSize.Height), Color.White)
|
||||
End Sub
|
||||
|
||||
Public Overrides Sub Update()
|
||||
|
|
|
@ -78,7 +78,13 @@
|
|||
|
||||
Dim background As Texture2D = TextureManager.GetTexture("GUI\Menus\MailboxBackground")
|
||||
|
||||
Core.SpriteBatch.Draw(background, New Rectangle(0, 0, backSize.Width, backSize.Height), Color.White)
|
||||
Dim xOffset As Integer = 0
|
||||
If windowSize.Width < backSize.Width Then
|
||||
Dim xAspectRatio As Single = CSng(origSize.Width / backSize.Width)
|
||||
xOffset = CInt(Math.Floor((backSize.Width - windowSize.Width) * xAspectRatio) / 2)
|
||||
End If
|
||||
|
||||
Core.SpriteBatch.Draw(background, New Rectangle(0, 0, backSize.Width, backSize.Height), New Rectangle(xOffset, 0, origSize.Width, origSize.Height), Color.White)
|
||||
Canvas.DrawRectangle(New Rectangle(32, 16, 240, 48), New Color(255, 255, 255, 224))
|
||||
Canvas.DrawRectangle(New Rectangle(48, 64 - 2, 208, 2), Color.DarkGray)
|
||||
|
||||
|
|
Loading…
Reference in New Issue