Fix visual of info of the inventory screen

This commit is contained in:
nilllzz 2018-01-07 18:28:50 +01:00
parent c8890fa5c4
commit 483284e3c6
1 changed files with 9 additions and 4 deletions

View File

@ -436,17 +436,22 @@ Public Class NewInventoryScreen
'Bring back when Monogame begins supporting this stuff
' Dim target As New RenderTarget2D(GraphicsDevice, _infoSize, 368, False, GraphicsDevice.PresentationParameters.BackBufferFormat, DepthFormat.Depth24Stencil8, 0, RenderTargetUsage.PreserveContents)
GraphicsDevice.SetRenderTarget(target_2)
GraphicsDevice.Clear(Color.Transparent)
'Render background:
infoBatch.BeginBatch()
Dim alpha = CInt(CSng(_infoSize) / 500 * 255)
For y = 0 To 368 Step 16
For x = 0 To _infoSize + 16 Step 16
infoBatch.Draw(_menuTexture, New Rectangle(x, y, 16, 16), New Rectangle(0, 0, 4, 4), New Color(128, 128, 128))
If x < _infoSize - 16 Then
infoBatch.Draw(_menuTexture, New Rectangle(x, y, 16, 16), New Rectangle(0, 0, 4, 4), New Color(128, 128, 128, alpha))
End If
Next
Next
Canvas.DrawGradient(infoBatch, New Rectangle(0, 0, 100, 368), New Color(0, 0, 0, 255), New Color(0, 0, 0, 0), True, -1)
Canvas.DrawGradient(infoBatch, New Rectangle(_infoSize - 100, 0, 100, 368), New Color(0, 0, 0, 0), New Color(0, 0, 0, 255), True, -1)
Canvas.DrawGradient(infoBatch, New Rectangle(0, 0, 100, 368), New Color(0, 0, 0, alpha), New Color(0, 0, 0, 0), True, -1)
Canvas.DrawGradient(infoBatch, New Rectangle(_infoSize - 100, 0, 100, 368), New Color(0, 0, 0, 0), New Color(0, 0, 0, alpha), True, -1)
'Get item and gets its display texts based on the item category:
Dim cItem As Item = Item.GetItemByID(_items(ItemIndex + PageIndex * 10).ItemID)
@ -510,7 +515,7 @@ Public Class NewInventoryScreen
'Set the target that was previously active and render the new target on top of that:
GraphicsDevice.SetRenderTarget(preTarget)
preBatch.Draw(target_2, New Rectangle(_infoPosition + 80, 0, target_2.Width, target_2.Height), Color.White)
preBatch.Draw(target_2, New Rectangle(_infoPosition + 80, 0, target_2.Width, target_2.Height), New Color(255, 255, 255, alpha))
End Sub
''' <summary>