【VB开源代码栏目提醒】:本文主要为网学会员提供editor.frm,希望对需要editor.frm网友有所帮助,学习一下!
VERSION 5.00
Begin VB.Form frmEditor
BackColor = &H00808000&
Caption = "Design you own Map:"
ClientHeight = 8595
ClientLeft = 1155
ClientTop = 1230
ClientWidth = 11880
LinkTopic = "Form1"
ScaleHeight = 8595
ScaleWidth = 11880
WindowState = 2 'Maximized
Begin VB.CommandButton gamescreen
Caption = "&Game screen"
Height = 495
Left = 10320
TabIndex = 11
Top = 1440
Width = 1335
End
Begin VB.PictureBox yourtankpic
Height = 615
Left = 120
Picture = "editor.frx":0000
ScaleHeight = 555
ScaleWidth = 555
TabIndex = 10
Top = 7920
Visible = 0 'False
Width = 615
End
Begin VB.PictureBox yourtank
BackColor = &H00808000&
BorderStyle = 0 'None
Height = 615
Left = 225
Picture = "editor.frx":069E
ScaleHeight = 615
ScaleWidth = 495
TabIndex = 9
ToolTipText = "Your Tank"
Top = 2490
Width = 495
End
Begin VB.PictureBox tank1pic
Height = 615
Left = 120
Picture = "editor.frx":0BF5
ScaleHeight = 555
ScaleWidth = 555
TabIndex = 8
Top = 7200
Visible = 0 'False
Width = 615
End
Begin VB.PictureBox emptyblock
BackColor = &H00808000&
BorderStyle = 0 'None
Height = 615
Left = 240
ScaleHeight = 615
ScaleWidth = 495
TabIndex = 7
ToolTipText = "Empty Block"
Top = 1695
Width = 495
End
Begin VB.PictureBox tank1
BackColor = &H00808000&
BorderStyle = 0 'None
Height = 615
Left = 240
Picture = "editor.frx":1293
ScaleHeight = 615
ScaleWidth = 495
TabIndex = 6
ToolTipText = "Enemy Tank"
Top = 885
Width = 495
End
Begin VB.PictureBox wall1
Height = 615
Left = 240
Picture = "editor.frx":1807
ScaleHeight = 555
ScaleWidth = 435
TabIndex = 5
ToolTipText = "Wall"
Top = 120
Width = 495
End
Begin VB.PictureBox currentpic
Height = 495
Left = 840
ScaleHeight = 435
ScaleWidth = 435
TabIndex = 4
Top = 8280
Visible = 0 'False
Width = 495
End
Begin VB.CommandButton cmdSave
Caption = "&Save"
Height = 495
Left = 10320
TabIndex = 2
Top = 600
Width = 1335
End
Begin VB.PictureBox block1
Appearance = 0 'Flat
BackColor = &H00C0C0C0&
BorderStyle = 0 'None
ForeColor = &H80000008&
Height = 495
Index = 0
Left = 1440
ScaleHeight = 495
ScaleWidth = 495
TabIndex = 1
Top = 8280
Visible = 0 'False
Width = 495
End
Begin VB.CommandButton exit
Caption = "&Exit"
Height = 495
Left = 10320
TabIndex = 0
Top = 2280
Width = 1335
End
Begin VB.Label map
BorderStyle = 1 'Fixed Single
Height = 8055
Left = 1035
TabIndex = 3
Top = 105
Width = 9135
End
End
Attribute VB_Name = "frmEditor"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim counter As Integer
Dim curx, cury As Integer
Dim gridx, gridy As Integer
Dim i, j As Integer
Dim clicked As Boolean
Dim mytankchosen As Boolean
Private Sub block1_Click(Index As Integer)
If block1(Index).Picture = yourtankpic.Picture Then
mytankchosen = False
yourtank.Enabled = True
End If
If mytankchosen = True And currentpic.Picture = yourtankpic.Picture Then Exit Sub
block1(Index).ZOrder (0)
block1(Index).Picture = currentpic.Picture
'block1(Index).BorderStyle = 1
If currentpic.Picture = yourtankpic.Picture Then
mytankchosen = True
yourtank.Enabled = False
End If
End Sub
Private Sub block1_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer)
If Shift = 1 Then clicked = True
End Sub
Private Sub block1_KeyUp(Index As Integer, KeyCode As Integer, Shift As Integer)
clicked = False
End Sub
Private Sub block1_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
If clicked = True Then
If block1(Index).Picture = yourtankpic.Picture Then
mytankchosen = False
yourtank.Enabled = True
End If
If currentpic.Picture <> yourtankpic.Picture Then
block1(Index).ZOrder (0)
block1(Index).Picture = currentpic.Picture
'block1(Index).BorderStyle = 1
End If
End If
End Sub
Private Sub cmdSave_Click()
Dim filename, description As String
Dim i As Integer
Di