home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Begin VB.Form Form1
- BorderStyle = 1 'Fixed Single
- Caption = "Sprite/Pic Editor"
- ClientHeight = 8415
- ClientLeft = 4200
- ClientTop = 480
- ClientWidth = 8070
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 8415
- ScaleWidth = 8070
- Begin VB.ListBox List6
- Height = 1035
- Left = 2880
- TabIndex = 34
- Top = 5160
- Width = 2535
- End
- Begin VB.TextBox Text9
- Height = 285
- Left = 360
- TabIndex = 32
- Top = 8040
- Width = 2415
- End
- Begin VB.TextBox Text7
- Height = 285
- Left = 360
- TabIndex = 30
- Top = 7680
- Width = 2415
- End
- Begin VB.TextBox Text8
- Height = 285
- Left = 360
- TabIndex = 28
- Top = 7320
- Width = 2415
- End
- Begin VB.TextBox Text6
- Height = 285
- Left = 360
- TabIndex = 26
- Top = 6960
- Width = 2415
- End
- Begin VB.TextBox Text5
- Height = 285
- Left = 120
- TabIndex = 24
- Top = 6600
- Width = 2655
- End
- Begin VB.ListBox List5
- Height = 1425
- Left = 120
- TabIndex = 23
- Top = 4800
- Width = 2655
- End
- Begin VB.ListBox List4
- Height = 645
- Left = 3000
- TabIndex = 22
- Top = 6720
- Width = 2415
- End
- Begin VB.TextBox Text4
- Height = 285
- Left = 3000
- TabIndex = 19
- Top = 7800
- Width = 2415
- End
- Begin VB.TextBox Text3
- Height = 285
- Left = 5520
- TabIndex = 17
- Top = 7800
- Width = 2415
- End
- Begin VB.ListBox List3
- Height = 1425
- Left = 5520
- TabIndex = 15
- Top = 6000
- Width = 2415
- End
- Begin VB.CheckBox Check1
- Caption = "Group Repeats"
- Height = 255
- Left = 5520
- TabIndex = 14
- Top = 5280
- Width = 2415
- End
- Begin VB.TextBox Text2
- Height = 285
- Left = 5520
- TabIndex = 11
- Top = 4920
- Width = 2415
- End
- Begin VB.ListBox List2
- Height = 1425
- Left = 5520
- TabIndex = 10
- Top = 3120
- Width = 2415
- End
- Begin VB.TextBox Text1
- Height = 285
- Left = 5520
- TabIndex = 8
- Top = 2280
- Width = 2415
- End
- Begin VB.ListBox List1
- Height = 1425
- Left = 5520
- TabIndex = 4
- Top = 480
- Width = 2415
- End
- Begin VB.HScrollBar HScroll1
- Height = 255
- LargeChange = 30
- Left = 120
- SmallChange = 10
- TabIndex = 3
- Top = 4440
- Width = 4935
- End
- Begin VB.VScrollBar VScroll1
- Height = 3855
- Left = 5160
- TabIndex = 2
- Top = 480
- Width = 255
- End
- Begin VB.PictureBox Picture1
- Height = 3855
- Left = 120
- ScaleHeight = 253
- ScaleMode = 3 'Pixel
- ScaleWidth = 325
- TabIndex = 0
- Top = 480
- Width = 4935
- Begin VB.PictureBox Picture2
- Appearance = 0 'Flat
- AutoSize = -1 'True
- BackColor = &H00000000&
- BorderStyle = 0 'None
- ForeColor = &H80000008&
- Height = 15
- Left = 0
- ScaleHeight = 1
- ScaleMode = 3 'Pixel
- ScaleWidth = 1
- TabIndex = 1
- Top = 0
- Width = 15
- End
- End
- Begin VB.Label Label14
- Caption = "Graphicslib"
- Height = 255
- Left = 2880
- TabIndex = 35
- Top = 4800
- Width = 1335
- End
- Begin VB.Line Line4
- X1 = 5400
- X2 = 2880
- Y1 = 6360
- Y2 = 6360
- End
- Begin VB.Label Label13
- Caption = "H"
- Height = 255
- Left = 120
- TabIndex = 33
- Top = 8040
- Width = 255
- End
- Begin VB.Label Label11
- Caption = "W"
- Height = 255
- Left = 120
- TabIndex = 31
- Top = 7680
- Width = 255
- End
- Begin VB.Label Label12
- Caption = "Y"
- Height = 255
- Left = 120
- TabIndex = 29
- Top = 7320
- Width = 255
- End
- Begin VB.Label Label10
- Caption = "X"
- Height = 255
- Left = 120
- TabIndex = 27
- Top = 6960
- Width = 255
- End
- Begin VB.Label Label9
- Caption = "Picture Name"
- Height = 255
- Left = 120
- TabIndex = 25
- Top = 6360
- Width = 1335
- End
- Begin VB.Line Line3
- X1 = 2880
- X2 = 2880
- Y1 = 6360
- Y2 = 8280
- End
- Begin VB.Label Label8
- Caption = "Picture"
- Height = 255
- Left = 3000
- TabIndex = 21
- Top = 6480
- Width = 1335
- End
- Begin VB.Label Label7
- Caption = "Duration"
- Height = 255
- Left = 3000
- TabIndex = 20
- Top = 7560
- Width = 2295
- End
- Begin VB.Label Label6
- Caption = "Name"
- Height = 255
- Left = 5520
- TabIndex = 18
- Top = 7560
- Width = 2295
- End
- Begin VB.Line Line2
- X1 = 5520
- X2 = 7920
- Y1 = 5640
- Y2 = 5640
- End
- Begin VB.Label Label5
- Caption = "Frames"
- Height = 255
- Left = 5520
- TabIndex = 16
- Top = 5760
- Width = 2295
- End
- Begin VB.Line Line1
- X1 = 5520
- X2 = 7920
- Y1 = 2760
- Y2 = 2760
- End
- Begin VB.Label Label4
- Caption = "Frame Groups"
- Height = 255
- Left = 5520
- TabIndex = 13
- Top = 2880
- Width = 2295
- End
- Begin VB.Label Label3
- Caption = "Name"
- Height = 255
- Left = 5520
- TabIndex = 12
- Top = 4680
- Width = 2295
- End
- Begin VB.Label Label2
- Caption = "Name"
- Height = 255
- Left = 5520
- TabIndex = 9
- Top = 2040
- Width = 2295
- End
- Begin VB.Shape Shape2
- Height = 255
- Left = 5160
- Top = 120
- Width = 255
- End
- Begin VB.Label YLabel
- BackColor = &H00FFFFFF&
- BorderStyle = 1 'Fixed Single
- Caption = "Y:"
- Height = 255
- Left = 2640
- TabIndex = 7
- Top = 120
- Width = 2415
- End
- Begin VB.Label XLabel
- BackColor = &H00FFFFFF&
- BorderStyle = 1 'Fixed Single
- Caption = "X: "
- Height = 255
- Left = 120
- TabIndex = 6
- Top = 120
- Width = 2415
- End
- Begin VB.Shape Shape1
- Height = 255
- Left = 5160
- Top = 4440
- Width = 255
- End
- Begin VB.Label Label1
- BackColor = &H00FFFFFF&
- BorderStyle = 1 'Fixed Single
- Height = 255
- Left = 5520
- TabIndex = 5
- Top = 120
- Width = 2415
- End
- Attribute VB_Name = "Form1"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Private Sub Check1_Click()
- If Form1.Check1.Value = 1 Then
- cval = True
- cval = False
- End If
- snum = Form1.List1.ListIndex
- gnum = Form1.List2.ListIndex
- Sprites(snum).SpriteFrameGroups(gnum).GroupRepeats = cval
- End Sub
- Private Sub Form_Load()
- Call LoadAll
- Form1.List1.AddItem "[NewSprite]"
- Form1.List2.AddItem "[NewGroup]"
- Form1.List3.AddItem "[NewFrame]"
- Form1.List5.AddItem "[NewPic]"
- Form1.List1.ListIndex = 0
- Form1.List2.ListIndex = 0
- Form1.List3.ListIndex = 0
- Form1.List6.ListIndex = -1
- Form1.List5.ListIndex = 0
- Call LoadGraphicLibs
- Call updateSpritenamelist
- Call UpdateLibList
- Call UpdatePicList
- Call updateSpritelist
- End Sub
- Private Sub Form_Unload(Cancel As Integer)
- Call SavePics
- Call SaveSprites
- End Sub
- Private Sub HScroll1_Change()
- Picture2.Left = -HScroll1.Value
- End Sub
- Private Sub List1_Click()
- Call UpdateSpriteProperties
- List2.ListIndex = 0
- List3.ListIndex = 0
- If List1.ListIndex <> 0 Then Call UpdateGroupList Else List2.Clear: List2.AddItem "[NewGroup]": List2.ListIndex = 0
- If List2.ListIndex <> 0 Then Call UpdateFrameList Else List3.Clear: List3.AddItem "[NewFrame]": List3.ListIndex = 0
- End Sub
- Private Sub List1_KeyUp(KeyCode As Integer, Shift As Integer)
- Select Case KeyCode
- Case 45 'insert
- For i = SpriteMax + 1 To List1.ListIndex + 1 Step -1
- Sprites(i).GroupMax = Sprites(i - 1).GroupMax
- Sprites(i).SpriteName = Sprites(i - 1).SpriteName
- For i2 = 1 To Sprites(i - 1).GroupMax
- Sprites(i).SpriteFrameGroups(i2).FrameMax = Sprites(i - 1).SpriteFrameGroups(i2).FrameMax
- Sprites(i).SpriteFrameGroups(i2).GroupRepeats = Sprites(i - 1).SpriteFrameGroups(i2).GroupRepeats
- Sprites(i).SpriteFrameGroups(i2).SpriteGroupName = Sprites(i - 1).SpriteFrameGroups(i2).SpriteGroupName
- For i3 = 1 To Sprites(i - 1).SpriteFrameGroups(i2).FrameMax
- Sprites(i).SpriteFrameGroups(i2).SpriteFrames(i3).Duration = Sprites(i - 1).SpriteFrameGroups(i2).SpriteFrames(i3).Duration
- Sprites(i).SpriteFrameGroups(i2).SpriteFrames(i3).FrameName = Sprites(i - 1).SpriteFrameGroups(i2).SpriteFrames(i3).FrameName
- Sprites(i).SpriteFrameGroups(i2).SpriteFrames(i3).picname = Sprites(i - 1).SpriteFrameGroups(i2).SpriteFrames(i3).picname
- Next i3
- Next i2
- Next i
- SpriteMax = SpriteMax + 1
- Call updateSpritelist
- Case 46 'delete
- For i = List1.ListIndex To SpriteMax
- Sprites(i).GroupMax = Sprites(i + 1).GroupMax
- Sprites(i).SpriteName = Sprites(i + 1).SpriteName
- For i2 = 1 To Sprites(i + 1).GroupMax
- Sprites(i).SpriteFrameGroups(i2).FrameMax = Sprites(i + 1).SpriteFrameGroups(i2).FrameMax
- Sprites(i).SpriteFrameGroups(i2).GroupRepeats = Sprites(i + 1).SpriteFrameGroups(i2).GroupRepeats
- Sprites(i).SpriteFrameGroups(i2).SpriteGroupName = Sprites(i + 1).SpriteFrameGroups(i2).SpriteGroupName
- For i3 = 1 To Sprites(i + 1).SpriteFrameGroups(i2).FrameMax
- Sprites(i).SpriteFrameGroups(i2).SpriteFrames(i3).Duration = Sprites(i + 1).SpriteFrameGroups(i2).SpriteFrames(i3).Duration
- Sprites(i).SpriteFrameGroups(i2).SpriteFrames(i3).FrameName = Sprites(i + 1).SpriteFrameGroups(i2).SpriteFrames(i3).FrameName
- Sprites(i).SpriteFrameGroups(i2).SpriteFrames(i3).picname = Sprites(i + 1).SpriteFrameGroups(i2).SpriteFrames(i3).picname
- Next i3
- Next i2
- Next i
- SpriteMax = SpriteMax - 1
- List1.ListIndex = List1.ListIndex - 1
- Call updateSpritelist
- End Select
- End Sub
- Private Sub List2_Click()
- Call UpdateGroupProperties
- List3.ListIndex = 0
- If List2.ListIndex <> 0 Then Call UpdateFrameList Else List3.Clear: List3.AddItem "[NewFrame]": List3.ListIndex = 0
- End Sub
- Private Sub List2_KeyUp(KeyCode As Integer, Shift As Integer)
- snum = List1.ListIndex
- Select Case KeyCode
- Case 45 'insert
- For i = Sprites(snum).GroupMax + 1 To List2.ListIndex + 1 Step -1
- Sprites(snum).SpriteFrameGroups(i).FrameMax = Sprites(snum).SpriteFrameGroups(i - 1).FrameMax
- Sprites(snum).SpriteFrameGroups(i).SpriteGroupName = Sprites(snum).SpriteFrameGroups(i - 1).SpriteGroupName
- For i2 = 1 To Sprites(snum).SpriteFrameGroups(i).FrameMax
- Sprites(snum).SpriteFrameGroups(i).SpriteFrames(i2).Duration = Sprites(snum).SpriteFrameGroups(i - 1).SpriteFrames(i2).Duration
- Sprites(snum).SpriteFrameGroups(i).SpriteFrames(i2).FrameName = Sprites(snum).SpriteFrameGroups(i - 1).SpriteFrames(i2).FrameName
- Sprites(snum).SpriteFrameGroups(i).SpriteFrames(i2).picname = Sprites(snum).SpriteFrameGroups(i - 1).SpriteFrames(i2).picname
- Next i2
- Next i
- Sprites(snum).GroupMax = Sprites(snum).GroupMax + 1
- Call UpdateGroupList
- Case 46 'delete
- For i = List2.ListIndex To Sprites(snum).GroupMax
- Sprites(snum).SpriteFrameGroups(i).FrameMax = Sprites(snum).SpriteFrameGroups(i + 1).FrameMax
- Sprites(snum).SpriteFrameGroups(i).GroupRepeats = Sprites(snum).SpriteFrameGroups(i + 1).GroupRepeats
- Sprites(snum).SpriteFrameGroups(i).SpriteGroupName = Sprites(snum).SpriteFrameGroups(i + 1).SpriteGroupName
- For i2 = 1 To Sprites(snum).SpriteFrameGroups(i + 1).FrameMax
- Sprites(snum).SpriteFrameGroups(i).SpriteFrames(i2).Duration = Sprites(snum).SpriteFrameGroups(i + 1).SpriteFrames(i2).Duration
- Sprites(snum).SpriteFrameGroups(i).SpriteFrames(i2).FrameName = Sprites(snum).SpriteFrameGroups(i + 1).SpriteFrames(i2).FrameName
- Sprites(snum).SpriteFrameGroups(i).SpriteFrames(i2).picname = Sprites(snum).SpriteFrameGroups(i + 1).SpriteFrames(i2).picname
- Next i2
- Next i
- Sprites(snum).GroupMax = Sprites(snum).GroupMax - 1
- List2.ListIndex = List2.ListIndex - 1
- Call UpdateGroupList
- End Select
- End Sub
- Private Sub List3_Click()
- Call UpdateFrameProperties
- End Sub
- Private Sub List4_Click()
- Sprites(List1.ListIndex).SpriteFrameGroups(List2.ListIndex).SpriteFrames(List3.ListIndex).picname = List4.List(List4.ListIndex)
- End Sub
- Private Sub List5_Click()
- Call UpdatePicProperties
- Call LoadLibPic
- End Sub
- Private Sub List5_KeyUp(KeyCode As Integer, Shift As Integer)
- If KeyCode = 46 Then 'delete
- found = False
- For i = 1 To SpriteMax
- For i2 = 1 To Sprites(i).GroupMax
- For i3 = 1 To Sprites(i).SpriteFrameGroups(i2).FrameMax
- If Sprites(i).SpriteFrameGroups(i2).SpriteFrames(i3).picname = List5.List(List5.ListIndex) Then found = True
- Next i3
- Next i2
- Next i
- If found = False Then
- For i = List5.ListIndex To PicMax
- Picz(i).GraphicsLib = Picz(i + 1).GraphicsLib
- Picz(i).Height = Picz(i + 1).Height
- Picz(i).Width = Picz(i + 1).Width
- Picz(i).X = Picz(i + 1).X
- Picz(i).Y = Picz(i + 1).Y
- Picz(i).Masked = Picz(i + 1).Masked
- Picz(i).picname = Picz(i + 1).picname
- Next i
- PicMax = PicMax - 1
- List5.ListIndex = List5.ListIndex - 1
- Call UpdatePicList
- Call updateSpritenamelist
- Else
- Beep
- MsgBox "This Picture is used by a Sprite and cannot be deleted."
- End If
- End If
- End Sub
- Private Sub List6_Click()
- Picz(List5.ListIndex).GraphicsLib = List6.List(List6.ListIndex)
- Call LoadLibPic
- End Sub
- Private Sub Picture2_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
- Picz(Form1.List5.ListIndex).X = X
- Picz(Form1.List5.ListIndex).Y = Y
- Picz(Form1.List5.ListIndex).Width = 0
- Picz(Form1.List5.ListIndex).Height = 0
- Call UpdatePicProperties
- Call redrawpicview
- End Sub
- Private Sub Picture2_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
- If X < 0 Then X = 0
- If Y < 0 Then Y = 0
- Form1.XLabel.Caption = "X: " & X
- Form1.YLabel.Caption = "Y: " & Y
- If Button = 1 Then
- Picz(Form1.List5.ListIndex).Width = X - Picz(Form1.List5.ListIndex).X
- Picz(Form1.List5.ListIndex).Height = Y - Picz(Form1.List5.ListIndex).Y
- Call UpdatePicProperties
- Call redrawpicview
- End If
- End Sub
- Private Sub Picture2_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
- If Picz(Form1.List5.ListIndex).Width < 0 Then
- TX = Picz(Form1.List5.ListIndex).X
- tw = Picz(Form1.List5.ListIndex).Width
- Picz(Form1.List5.ListIndex).X = TX + Picz(Form1.List5.ListIndex).Width
- Picz(Form1.List5.ListIndex).Width = (tw + TX) - tw
- End If
- If Picz(Form1.List5.ListIndex).Height < 0 Then
- Ty = Picz(Form1.List5.ListIndex).Y
- Th = Picz(Form1.List5.ListIndex).Height
- Picz(Form1.List5.ListIndex).Y = Ty + Picz(Form1.List5.ListIndex).Height
- Picz(Form1.List5.ListIndex).Height = (Th + Ty) - Th
- End If
- Call UpdatePicProperties
- End Sub
- Private Sub Picture2_Paint()
- Call redrawpicview
- End Sub
- Private Sub Text1_KeyUp(KeyCode As Integer, Shift As Integer)
- If List1.ListIndex = 0 Then
- ttext = Form1.Text1.Text
- SpriteMax = SpriteMax + 1
- Call updateSpritelist
- Call UpdateSpriteProperties
- List1.ListIndex = SpriteMax
- Form1.Text1.Text = ttext
- Form1.Text1.SelStart = Len(Form1.Text1.Text)
- End If
- Sprites(List1.ListIndex).SpriteName = Text1.Text
- Call UpdateSpriteProperties
- Call updateSpritelist
- End Sub
- Private Sub Text2_KeyUp(KeyCode As Integer, Shift As Integer)
- snum = List1.ListIndex
- If List2.ListIndex = 0 Then
- ttext = Form1.Text2.Text
- Sprites(snum).GroupMax = Sprites(snum).GroupMax + 1
- Call UpdateGroupList
- Call UpdateGroupProperties
- List2.ListIndex = Sprites(snum).GroupMax
- Form1.Text2.Text = ttext
- Form1.Text2.SelStart = Len(Form1.Text2.Text)
- End If
- Sprites(snum).SpriteFrameGroups(Form1.List2.ListIndex).SpriteGroupName = Text2.Text
- Call UpdateGroupProperties
- Call UpdateGroupList
- End Sub
- Private Sub Text3_KeyUp(KeyCode As Integer, Shift As Integer)
- snum = List1.ListIndex
- gnum = List2.ListIndex
- fnum = List3.ListIndex
- If List3.ListIndex = 0 Then
- ttext = Form1.Text3.Text
- Sprites(snum).SpriteFrameGroups(gnum).FrameMax = Sprites(snum).SpriteFrameGroups(gnum).FrameMax + 1
- fnum = Sprites(snum).SpriteFrameGroups(gnum).FrameMax
- Call UpdateFrameList
- Call UpdateFrameProperties
- List3.ListIndex = Sprites(snum).SpriteFrameGroups(gnum).FrameMax
- Form1.Text3.Text = ttext
- Form1.Text3.SelStart = Len(Form1.Text3.Text)
- End If
- Sprites(snum).SpriteFrameGroups(gnum).SpriteFrames(fnum).FrameName = Text3.Text
- Call UpdateFrameProperties
- Call UpdateFrameList
- End Sub
- Private Sub Text4_KeyUp(KeyCode As Integer, Shift As Integer)
- Sprites(List1.ListIndex).SpriteFrameGroups(List2.ListIndex).SpriteFrames(List3.ListIndex).Duration = Val(Text4.Text)
- End Sub
- Private Sub Text5_KeyUp(KeyCode As Integer, Shift As Integer)
- snum = List5.ListIndex
- If List5.ListIndex = 0 Then
- ttext = Form1.Text5.Text
- PicMax = PicMax + 1
- Call UpdatePicList
- Call UpdatePicProperties
- List5.ListIndex = PicMax
- Form1.Text5.Text = ttext
- Form1.Text5.SelStart = Len(Form1.Text5.Text)
- Call LoadLibPic
- Picz(List5.ListIndex).GraphicsLib = List6.List(List6.ListIndex)
- End If
- Picz(List5.ListIndex).picname = Text5.Text
- Call updateSpritenamelist
- Call UpdatePicProperties
- Call UpdatePicList
- End Sub
- Private Sub Text6_KeyUp(KeyCode As Integer, Shift As Integer)
- Picz(List5.ListIndex).X = Val(Text6.Text)
- Call redrawpicview
- End Sub
- Private Sub Text7_KeyUp(KeyCode As Integer, Shift As Integer)
- Picz(List5.ListIndex).Width = Val(Text7.Text)
- Call redrawpicview
- End Sub
- Private Sub Text8_KeyUp(KeyCode As Integer, Shift As Integer)
- Picz(List5.ListIndex).Y = Val(Text8.Text)
- Call redrawpicview
- End Sub
- Private Sub Text9_KeyUp(KeyCode As Integer, Shift As Integer)
- Picz(List5.ListIndex).Height = Val(Text9.Text)
- Call redrawpicview
- End Sub
- Private Sub VScroll1_Change()
- Picture2.Top = -VScroll1.Value
- End Sub
-