Make slight changes to layout, add deck for future animation, add a size attribute
parent
959b3cd71d
commit
98d7967726
|
@ -6,6 +6,7 @@
|
||||||
Private card As (suit As String, number As String)
|
Private card As (suit As String, number As String)
|
||||||
Private cardLocation As Point
|
Private cardLocation As Point
|
||||||
Private cardHidden As Boolean
|
Private cardHidden As Boolean
|
||||||
|
Private size As Size
|
||||||
|
|
||||||
Public Sub New(name As (String, String), Optional hidden As Boolean = False)
|
Public Sub New(name As (String, String), Optional hidden As Boolean = False)
|
||||||
id = idCounter
|
id = idCounter
|
||||||
|
@ -14,6 +15,7 @@
|
||||||
card = name
|
card = name
|
||||||
cardHidden = hidden
|
cardHidden = hidden
|
||||||
cardImage = Utilities.GetCardImage(name, hidden)
|
cardImage = Utilities.GetCardImage(name, hidden)
|
||||||
|
size = New Size(125,175)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Public Sub SetLocation(location As point)
|
Public Sub SetLocation(location As point)
|
||||||
|
|
|
@ -38,6 +38,7 @@ Partial Class GameWindow
|
||||||
PlayerTotal = New Label()
|
PlayerTotal = New Label()
|
||||||
DealerTotal = New Label()
|
DealerTotal = New Label()
|
||||||
WinMessage = New Label()
|
WinMessage = New Label()
|
||||||
|
deckPictureBox = New PictureBox()
|
||||||
CType(PlayerCard1, ComponentModel.ISupportInitialize).BeginInit()
|
CType(PlayerCard1, ComponentModel.ISupportInitialize).BeginInit()
|
||||||
CType(PlayerCard2, ComponentModel.ISupportInitialize).BeginInit()
|
CType(PlayerCard2, ComponentModel.ISupportInitialize).BeginInit()
|
||||||
CType(PlayerCard3, ComponentModel.ISupportInitialize).BeginInit()
|
CType(PlayerCard3, ComponentModel.ISupportInitialize).BeginInit()
|
||||||
|
@ -48,11 +49,12 @@ Partial Class GameWindow
|
||||||
CType(PlayerCard8, ComponentModel.ISupportInitialize).BeginInit()
|
CType(PlayerCard8, ComponentModel.ISupportInitialize).BeginInit()
|
||||||
CType(PlayerCard9, ComponentModel.ISupportInitialize).BeginInit()
|
CType(PlayerCard9, ComponentModel.ISupportInitialize).BeginInit()
|
||||||
CType(PlayerCard10, ComponentModel.ISupportInitialize).BeginInit()
|
CType(PlayerCard10, ComponentModel.ISupportInitialize).BeginInit()
|
||||||
|
CType(deckPictureBox, ComponentModel.ISupportInitialize).BeginInit()
|
||||||
SuspendLayout()
|
SuspendLayout()
|
||||||
'
|
'
|
||||||
' HitButton
|
' HitButton
|
||||||
'
|
'
|
||||||
HitButton.Anchor = AnchorStyles.Top Or AnchorStyles.Right
|
HitButton.Anchor = AnchorStyles.Bottom Or AnchorStyles.Left
|
||||||
HitButton.Enabled = False
|
HitButton.Enabled = False
|
||||||
HitButton.Font = New Font("Segoe UI", 36.0F, FontStyle.Regular, GraphicsUnit.Point)
|
HitButton.Font = New Font("Segoe UI", 36.0F, FontStyle.Regular, GraphicsUnit.Point)
|
||||||
HitButton.Location = New Point(100, 490)
|
HitButton.Location = New Point(100, 490)
|
||||||
|
@ -64,7 +66,7 @@ Partial Class GameWindow
|
||||||
'
|
'
|
||||||
' StandButton
|
' StandButton
|
||||||
'
|
'
|
||||||
StandButton.Anchor = AnchorStyles.Top Or AnchorStyles.Right
|
StandButton.Anchor = AnchorStyles.Bottom Or AnchorStyles.Right
|
||||||
StandButton.Enabled = False
|
StandButton.Enabled = False
|
||||||
StandButton.Font = New Font("Segoe UI", 36.0F, FontStyle.Regular, GraphicsUnit.Point)
|
StandButton.Font = New Font("Segoe UI", 36.0F, FontStyle.Regular, GraphicsUnit.Point)
|
||||||
StandButton.Location = New Point(780, 490)
|
StandButton.Location = New Point(780, 490)
|
||||||
|
@ -76,11 +78,11 @@ Partial Class GameWindow
|
||||||
'
|
'
|
||||||
' PlayerCard1
|
' PlayerCard1
|
||||||
'
|
'
|
||||||
PlayerCard1.Anchor = AnchorStyles.Top Or AnchorStyles.Right
|
PlayerCard1.Anchor = AnchorStyles.Bottom Or AnchorStyles.Left
|
||||||
PlayerCard1.ErrorImage = My.Resources.Resources.blue2
|
PlayerCard1.ErrorImage = My.Resources.Resources.blue2
|
||||||
PlayerCard1.Image = My.Resources.Resources.blue
|
PlayerCard1.Image = My.Resources.Resources.blue
|
||||||
PlayerCard1.InitialImage = My.Resources.Resources.blue2
|
PlayerCard1.InitialImage = My.Resources.Resources.blue2
|
||||||
PlayerCard1.Location = New Point(150, 284)
|
PlayerCard1.Location = New Point(150, 303)
|
||||||
PlayerCard1.Name = "PlayerCard1"
|
PlayerCard1.Name = "PlayerCard1"
|
||||||
PlayerCard1.Size = New Size(125, 175)
|
PlayerCard1.Size = New Size(125, 175)
|
||||||
PlayerCard1.TabIndex = 2
|
PlayerCard1.TabIndex = 2
|
||||||
|
@ -88,11 +90,11 @@ Partial Class GameWindow
|
||||||
'
|
'
|
||||||
' PlayerCard2
|
' PlayerCard2
|
||||||
'
|
'
|
||||||
PlayerCard2.Anchor = AnchorStyles.Top Or AnchorStyles.Right
|
PlayerCard2.Anchor = AnchorStyles.Bottom Or AnchorStyles.Left
|
||||||
PlayerCard2.ErrorImage = My.Resources.Resources.blue2
|
PlayerCard2.ErrorImage = My.Resources.Resources.blue2
|
||||||
PlayerCard2.Image = My.Resources.Resources.blue
|
PlayerCard2.Image = My.Resources.Resources.blue
|
||||||
PlayerCard2.InitialImage = My.Resources.Resources.blue2
|
PlayerCard2.InitialImage = My.Resources.Resources.blue2
|
||||||
PlayerCard2.Location = New Point(375, 284)
|
PlayerCard2.Location = New Point(364, 303)
|
||||||
PlayerCard2.Name = "PlayerCard2"
|
PlayerCard2.Name = "PlayerCard2"
|
||||||
PlayerCard2.Size = New Size(125, 175)
|
PlayerCard2.Size = New Size(125, 175)
|
||||||
PlayerCard2.TabIndex = 3
|
PlayerCard2.TabIndex = 3
|
||||||
|
@ -100,10 +102,10 @@ Partial Class GameWindow
|
||||||
'
|
'
|
||||||
' PlayerCard3
|
' PlayerCard3
|
||||||
'
|
'
|
||||||
PlayerCard3.Anchor = AnchorStyles.Top Or AnchorStyles.Right
|
PlayerCard3.Anchor = AnchorStyles.Bottom
|
||||||
PlayerCard3.ErrorImage = Nothing
|
PlayerCard3.ErrorImage = Nothing
|
||||||
PlayerCard3.InitialImage = Nothing
|
PlayerCard3.InitialImage = Nothing
|
||||||
PlayerCard3.Location = New Point(578, 284)
|
PlayerCard3.Location = New Point(578, 303)
|
||||||
PlayerCard3.Name = "PlayerCard3"
|
PlayerCard3.Name = "PlayerCard3"
|
||||||
PlayerCard3.Size = New Size(125, 175)
|
PlayerCard3.Size = New Size(125, 175)
|
||||||
PlayerCard3.TabIndex = 4
|
PlayerCard3.TabIndex = 4
|
||||||
|
@ -111,10 +113,10 @@ Partial Class GameWindow
|
||||||
'
|
'
|
||||||
' PlayerCard4
|
' PlayerCard4
|
||||||
'
|
'
|
||||||
PlayerCard4.Anchor = AnchorStyles.Top Or AnchorStyles.Right
|
PlayerCard4.Anchor = AnchorStyles.Bottom Or AnchorStyles.Right
|
||||||
PlayerCard4.ErrorImage = Nothing
|
PlayerCard4.ErrorImage = Nothing
|
||||||
PlayerCard4.InitialImage = Nothing
|
PlayerCard4.InitialImage = Nothing
|
||||||
PlayerCard4.Location = New Point(780, 284)
|
PlayerCard4.Location = New Point(792, 303)
|
||||||
PlayerCard4.Name = "PlayerCard4"
|
PlayerCard4.Name = "PlayerCard4"
|
||||||
PlayerCard4.Size = New Size(125, 175)
|
PlayerCard4.Size = New Size(125, 175)
|
||||||
PlayerCard4.TabIndex = 5
|
PlayerCard4.TabIndex = 5
|
||||||
|
@ -122,10 +124,10 @@ Partial Class GameWindow
|
||||||
'
|
'
|
||||||
' PlayerCard5
|
' PlayerCard5
|
||||||
'
|
'
|
||||||
PlayerCard5.Anchor = AnchorStyles.Top Or AnchorStyles.Right
|
PlayerCard5.Anchor = AnchorStyles.Bottom Or AnchorStyles.Right
|
||||||
PlayerCard5.ErrorImage = Nothing
|
PlayerCard5.ErrorImage = Nothing
|
||||||
PlayerCard5.InitialImage = Nothing
|
PlayerCard5.InitialImage = Nothing
|
||||||
PlayerCard5.Location = New Point(1005, 284)
|
PlayerCard5.Location = New Point(1005, 303)
|
||||||
PlayerCard5.Name = "PlayerCard5"
|
PlayerCard5.Name = "PlayerCard5"
|
||||||
PlayerCard5.Size = New Size(125, 175)
|
PlayerCard5.Size = New Size(125, 175)
|
||||||
PlayerCard5.TabIndex = 6
|
PlayerCard5.TabIndex = 6
|
||||||
|
@ -151,7 +153,7 @@ Partial Class GameWindow
|
||||||
PlayerCard7.ErrorImage = My.Resources.Resources.blue2
|
PlayerCard7.ErrorImage = My.Resources.Resources.blue2
|
||||||
PlayerCard7.Image = My.Resources.Resources.blue
|
PlayerCard7.Image = My.Resources.Resources.blue
|
||||||
PlayerCard7.InitialImage = My.Resources.Resources.blue2
|
PlayerCard7.InitialImage = My.Resources.Resources.blue2
|
||||||
PlayerCard7.Location = New Point(780, 12)
|
PlayerCard7.Location = New Point(792, 12)
|
||||||
PlayerCard7.Name = "PlayerCard7"
|
PlayerCard7.Name = "PlayerCard7"
|
||||||
PlayerCard7.Size = New Size(125, 175)
|
PlayerCard7.Size = New Size(125, 175)
|
||||||
PlayerCard7.TabIndex = 10
|
PlayerCard7.TabIndex = 10
|
||||||
|
@ -159,7 +161,7 @@ Partial Class GameWindow
|
||||||
'
|
'
|
||||||
' PlayerCard8
|
' PlayerCard8
|
||||||
'
|
'
|
||||||
PlayerCard8.Anchor = AnchorStyles.Top Or AnchorStyles.Right
|
PlayerCard8.Anchor = AnchorStyles.Top
|
||||||
PlayerCard8.ErrorImage = Nothing
|
PlayerCard8.ErrorImage = Nothing
|
||||||
PlayerCard8.InitialImage = Nothing
|
PlayerCard8.InitialImage = Nothing
|
||||||
PlayerCard8.Location = New Point(578, 12)
|
PlayerCard8.Location = New Point(578, 12)
|
||||||
|
@ -170,10 +172,9 @@ Partial Class GameWindow
|
||||||
'
|
'
|
||||||
' PlayerCard9
|
' PlayerCard9
|
||||||
'
|
'
|
||||||
PlayerCard9.Anchor = AnchorStyles.Top Or AnchorStyles.Right
|
|
||||||
PlayerCard9.ErrorImage = Nothing
|
PlayerCard9.ErrorImage = Nothing
|
||||||
PlayerCard9.InitialImage = Nothing
|
PlayerCard9.InitialImage = Nothing
|
||||||
PlayerCard9.Location = New Point(375, 12)
|
PlayerCard9.Location = New Point(364, 12)
|
||||||
PlayerCard9.Name = "PlayerCard9"
|
PlayerCard9.Name = "PlayerCard9"
|
||||||
PlayerCard9.Size = New Size(125, 175)
|
PlayerCard9.Size = New Size(125, 175)
|
||||||
PlayerCard9.TabIndex = 8
|
PlayerCard9.TabIndex = 8
|
||||||
|
@ -181,7 +182,6 @@ Partial Class GameWindow
|
||||||
'
|
'
|
||||||
' PlayerCard10
|
' PlayerCard10
|
||||||
'
|
'
|
||||||
PlayerCard10.Anchor = AnchorStyles.Top Or AnchorStyles.Right
|
|
||||||
PlayerCard10.ErrorImage = Nothing
|
PlayerCard10.ErrorImage = Nothing
|
||||||
PlayerCard10.InitialImage = Nothing
|
PlayerCard10.InitialImage = Nothing
|
||||||
PlayerCard10.Location = New Point(150, 12)
|
PlayerCard10.Location = New Point(150, 12)
|
||||||
|
@ -192,7 +192,7 @@ Partial Class GameWindow
|
||||||
'
|
'
|
||||||
' StartGame
|
' StartGame
|
||||||
'
|
'
|
||||||
StartGame.Anchor = AnchorStyles.Top Or AnchorStyles.Right
|
StartGame.Anchor = AnchorStyles.Bottom
|
||||||
StartGame.Font = New Font("Segoe UI", 26.25F, FontStyle.Regular, GraphicsUnit.Point)
|
StartGame.Font = New Font("Segoe UI", 26.25F, FontStyle.Regular, GraphicsUnit.Point)
|
||||||
StartGame.Location = New Point(535, 490)
|
StartGame.Location = New Point(535, 490)
|
||||||
StartGame.Name = "StartGame"
|
StartGame.Name = "StartGame"
|
||||||
|
@ -203,6 +203,7 @@ Partial Class GameWindow
|
||||||
'
|
'
|
||||||
' PlayerTotal
|
' PlayerTotal
|
||||||
'
|
'
|
||||||
|
PlayerTotal.Anchor = AnchorStyles.Bottom
|
||||||
PlayerTotal.AutoSize = True
|
PlayerTotal.AutoSize = True
|
||||||
PlayerTotal.Font = New Font("Segoe UI", 15.75F, FontStyle.Regular, GraphicsUnit.Point)
|
PlayerTotal.Font = New Font("Segoe UI", 15.75F, FontStyle.Regular, GraphicsUnit.Point)
|
||||||
PlayerTotal.Location = New Point(535, 561)
|
PlayerTotal.Location = New Point(535, 561)
|
||||||
|
@ -213,6 +214,7 @@ Partial Class GameWindow
|
||||||
'
|
'
|
||||||
' DealerTotal
|
' DealerTotal
|
||||||
'
|
'
|
||||||
|
DealerTotal.Anchor = AnchorStyles.Bottom
|
||||||
DealerTotal.AutoSize = True
|
DealerTotal.AutoSize = True
|
||||||
DealerTotal.Font = New Font("Segoe UI", 15.75F, FontStyle.Regular, GraphicsUnit.Point)
|
DealerTotal.Font = New Font("Segoe UI", 15.75F, FontStyle.Regular, GraphicsUnit.Point)
|
||||||
DealerTotal.Location = New Point(535, 610)
|
DealerTotal.Location = New Point(535, 610)
|
||||||
|
@ -230,10 +232,25 @@ Partial Class GameWindow
|
||||||
WinMessage.Size = New Size(0, 30)
|
WinMessage.Size = New Size(0, 30)
|
||||||
WinMessage.TabIndex = 15
|
WinMessage.TabIndex = 15
|
||||||
'
|
'
|
||||||
|
' deckPictureBox
|
||||||
|
'
|
||||||
|
deckPictureBox.Anchor = AnchorStyles.Top Or AnchorStyles.Right
|
||||||
|
deckPictureBox.BackgroundImageLayout = ImageLayout.None
|
||||||
|
deckPictureBox.ErrorImage = My.Resources.Resources.blue2
|
||||||
|
deckPictureBox.Image = My.Resources.Resources.blue
|
||||||
|
deckPictureBox.InitialImage = My.Resources.Resources.blue2
|
||||||
|
deckPictureBox.Location = New Point(1136, 156)
|
||||||
|
deckPictureBox.Name = "deckPictureBox"
|
||||||
|
deckPictureBox.Size = New Size(125, 175)
|
||||||
|
deckPictureBox.SizeMode = PictureBoxSizeMode.Zoom
|
||||||
|
deckPictureBox.TabIndex = 16
|
||||||
|
deckPictureBox.TabStop = False
|
||||||
|
'
|
||||||
' GameWindow
|
' GameWindow
|
||||||
'
|
'
|
||||||
AutoScaleMode = AutoScaleMode.Inherit
|
AutoScaleMode = AutoScaleMode.Inherit
|
||||||
ClientSize = New Size(1264, 681)
|
ClientSize = New Size(1264, 681)
|
||||||
|
Controls.Add(deckPictureBox)
|
||||||
Controls.Add(WinMessage)
|
Controls.Add(WinMessage)
|
||||||
Controls.Add(DealerTotal)
|
Controls.Add(DealerTotal)
|
||||||
Controls.Add(PlayerTotal)
|
Controls.Add(PlayerTotal)
|
||||||
|
@ -264,6 +281,7 @@ Partial Class GameWindow
|
||||||
CType(PlayerCard8, ComponentModel.ISupportInitialize).EndInit()
|
CType(PlayerCard8, ComponentModel.ISupportInitialize).EndInit()
|
||||||
CType(PlayerCard9, ComponentModel.ISupportInitialize).EndInit()
|
CType(PlayerCard9, ComponentModel.ISupportInitialize).EndInit()
|
||||||
CType(PlayerCard10, ComponentModel.ISupportInitialize).EndInit()
|
CType(PlayerCard10, ComponentModel.ISupportInitialize).EndInit()
|
||||||
|
CType(deckPictureBox, ComponentModel.ISupportInitialize).EndInit()
|
||||||
ResumeLayout(False)
|
ResumeLayout(False)
|
||||||
PerformLayout()
|
PerformLayout()
|
||||||
End Sub
|
End Sub
|
||||||
|
@ -284,4 +302,5 @@ Partial Class GameWindow
|
||||||
Friend WithEvents PlayerTotal As Label
|
Friend WithEvents PlayerTotal As Label
|
||||||
Friend WithEvents DealerTotal As Label
|
Friend WithEvents DealerTotal As Label
|
||||||
Friend WithEvents WinMessage As Label
|
Friend WithEvents WinMessage As Label
|
||||||
|
Friend WithEvents deckPictureBox As PictureBox
|
||||||
End Class
|
End Class
|
||||||
|
|
Loading…
Reference in New Issue