home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Planet Source Code Jumbo …e CD Visual Basic 1 to 7
/
6_2008-2009.ISO
/
data
/
zips
/
Muscles_Dr2211729192011.psc
/
frmEditor.frm
< prev
Wrap
Text File
|
2011-09-19
|
18KB
|
656 lines
VERSION 5.00
Begin VB.Form frmEditor
Caption = "Doll Editor"
ClientHeight = 8190
ClientLeft = 60
ClientTop = 450
ClientWidth = 11100
Icon = "frmEditor.frx":0000
LinkTopic = "Form1"
ScaleHeight = 546
ScaleMode = 3 'Pixel
ScaleWidth = 740
StartUpPosition = 1 'CenterOwner
Begin VB.CommandButton cmdUNDO1
Caption = "Undo"
Height = 615
Left = 9360
TabIndex = 34
Top = 1680
Width = 735
End
Begin VB.Timer Timer1
Enabled = 0 'False
Interval = 10
Left = 10440
Top = 2040
End
Begin VB.CheckBox RunTest
Caption = "TEST"
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 9360
Style = 1 'Graphical
TabIndex = 32
Top = 840
Width = 975
End
Begin VB.HScrollBar LoadScale
Height = 255
Left = 7560
Max = 200
Min = 35
TabIndex = 28
Top = 7440
Value = 100
Width = 3375
End
Begin VB.FileListBox File1
Height = 1845
Left = 7560
TabIndex = 27
Top = 5520
Width = 3375
End
Begin VB.CheckBox chShowNum
Caption = "Show Numbers"
Height = 495
Left = 9360
TabIndex = 26
Top = 2280
Width = 975
End
Begin VB.Frame fLink
Caption = "Link Options"
Height = 2535
Left = 7560
TabIndex = 6
Top = 2880
Width = 3375
Begin VB.PictureBox PicThick
Appearance = 0 'Flat
AutoRedraw = -1 'True
BackColor = &H00000000&
ForeColor = &H80000008&
Height = 855
Left = 120
ScaleHeight = 55
ScaleMode = 3 'Pixel
ScaleWidth = 95
TabIndex = 31
Top = 840
Width = 1455
End
Begin VB.PictureBox PicColor
Appearance = 0 'Flat
AutoRedraw = -1 'True
BackColor = &H80000005&
ForeColor = &H80000008&
Height = 855
Left = 1680
ScaleHeight = 55
ScaleMode = 3 'Pixel
ScaleWidth = 47
TabIndex = 16
Top = 840
Width = 735
End
Begin VB.VScrollBar sB
Height = 1335
Left = 3000
Max = 255
TabIndex = 15
Top = 480
Width = 255
End
Begin VB.VScrollBar sG
Height = 1335
Left = 2760
Max = 255
TabIndex = 14
Top = 480
Value = 255
Width = 255
End
Begin VB.VScrollBar sR
Height = 1335
Left = 2520
Max = 255
TabIndex = 13
Top = 480
Width = 255
End
Begin VB.HScrollBar sThickness
Height = 255
Left = 120
Max = 12
Min = 1
TabIndex = 10
Top = 480
Value = 3
Width = 1455
End
Begin VB.Frame frHT
Caption = "Draw Type"
Height = 615
Left = 120
TabIndex = 22
Top = 1800
Width = 3135
Begin VB.OptionButton oSticky
Caption = "Sticky"
Height = 255
Left = 120
TabIndex = 25
Top = 240
Value = -1 'True
Width = 975
End
Begin VB.OptionButton oFilledCircle
Caption = "Filled Circle"
Height = 255
Left = 1080
TabIndex = 24
Top = 240
Width = 1095
End
Begin VB.OptionButton oSmile
Caption = "Smile"
Enabled = 0 'False
Height = 255
Left = 2280
TabIndex = 23
Top = 240
Width = 735
End
End
Begin VB.Label Label2
Caption = "R G B"
Height = 255
Left = 2640
TabIndex = 12
Top = 240
Width = 495
End
Begin VB.Label Label1
Caption = "Thickness 1"
Height = 255
Left = 120
TabIndex = 11
Top = 240
Width = 975
End
End
Begin VB.CommandButton cmdExit
Caption = "EXIT"
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 10080
TabIndex = 21
Top = 120
Width = 855
End
Begin VB.Timer TimerM
Enabled = 0 'False
Interval = 75
Left = 10440
Top = 2520
End
Begin VB.CommandButton SaveDoll
Caption = "Save Doll"
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 7560
TabIndex = 17
Top = 840
Width = 1575
End
Begin VB.Frame fPoint
Caption = "Point Options"
Height = 735
Left = 7560
TabIndex = 5
Top = 2880
Width = 1575
Begin VB.CheckBox chUnMovable
Caption = "UnMovable"
Height = 255
Left = 120
TabIndex = 7
Top = 240
Width = 1335
End
End
Begin VB.CommandButton cmdClearAll
Caption = "Clear All"
Height = 375
Left = 7560
TabIndex = 4
Top = 240
Width = 1575
End
Begin VB.Frame Frame1
Caption = "Add Entity"
Height = 1215
Left = 7560
TabIndex = 1
Top = 1440
Width = 1575
Begin VB.OptionButton oMuscle
Caption = "Muscle"
Height = 255
Left = 120
TabIndex = 8
Top = 720
Width = 855
End
Begin VB.OptionButton oLink
Caption = "Link"
Height = 255
Left = 120
TabIndex = 3
Top = 480
Width = 855
End
Begin VB.OptionButton oPOINT
Caption = "Point"
Height = 255
Left = 120
TabIndex = 2
Top = 240
Value = -1 'True
Width = 855
End
Begin VB.Label Lmuscle
Caption = "0"
Height = 255
Left = 960
TabIndex = 20
Top = 720
Width = 495
End
Begin VB.Label Llink
Caption = "0"
Height = 255
Left = 960
TabIndex = 19
Top = 480
Width = 495
End
Begin VB.Label Lpoint
Caption = "0"
Height = 255
Left = 960
TabIndex = 18
Top = 240
Width = 495
End
End
Begin VB.PictureBox PIC
Appearance = 0 'Flat
AutoRedraw = -1 'True
BackColor = &H00004000&
DrawStyle = 5 'Transparent
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H80000008&
Height = 7215
Left = 120
ScaleHeight = 479
ScaleMode = 3 'Pixel
ScaleWidth = 479
TabIndex = 0
Top = 240
Width = 7215
End
Begin VB.Frame fMuscle
Caption = "Muscle Options"
Height = 495
Left = 7560
TabIndex = 9
Top = 2880
Width = 1575
End
Begin VB.Label Label5
Caption = "Use Mouse to Interact"
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 120
TabIndex = 33
Top = 7560
Visible = 0 'False
Width = 2895
End
Begin VB.Label Label4
Caption = "Load/Save Scale"
Height = 255
Left = 7560
TabIndex = 30
Top = 7800
Width = 1455
End
Begin VB.Label Label3
Caption = "1"
Height = 255
Left = 9000
TabIndex = 29
Top = 7800
Width = 495
End
End
Attribute VB_Name = "frmEditor"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'Author : Creator Roberto Mior
' reexre@gmail.com
'
'If you use source code or part of it please cite the author
'You can use this code however you like providing the above credits remain intact
'
'
'
Option Explicit
Private DOLL As New OBJphysic
Private FPointSelected As Boolean
Private Closest As Integer
Private Closest2 As Integer
Private Color As Long
Private FLinkSelected As Boolean
Private defStren As Double
Private x1 As Single
Private y1 As Single
Private x2 As Single
Private y2 As Single
Private InteractWith As Integer
Private PtoMove As Integer
Private mouseX As Single
Private mouseY As Single
Private Sub Check1_Click()
End Sub
Private Sub chShowNum_Click()
DRAWDOLL
End Sub
Private Sub cmdClearAll_Click()
RunTest.Value = Unchecked
PIC.Cls
DOLL.DestroyMe
FPointSelected = False
FLinkSelected = False
oPOINT = True
Lpoint = 0
Llink = 0
Lmuscle = 0
End Sub
Private Sub cmdExit_Click()
End
End Sub
Private Sub cmdUNDO1_Click()
If oPOINT Then
If DOLL.Npoints > 0 Then DOLL.Npoints = DOLL.Npoints - 1
End If
If oLink Then
If DOLL.Nlinks > 0 Then DOLL.Nlinks = DOLL.Nlinks - 1
End If
If oMuscle Then
If DOLL.NMuscles > 0 Then DOLL.NMuscles = DOLL.NMuscles - 1
End If
DRAWDOLL
End Sub
Private Sub File1_DblClick()
DOLL.DestroyMe
DOLL.OBJ_LOADandPlace File1, PIC.Width \ 2, PIC.Height \ 2, LoadScale / 100
DRAWDOLL
Lpoint = DOLL.Npoints
Llink = DOLL.Nlinks
Lmuscle = DOLL.NMuscles
End Sub
Private Sub Form_Activate()
SelectChange
defStren = 0.03 * 1.2
DOLL.GlobalMAXStrength = defStren
DOLL.CurrentMAXStrength = defStren
DOLL.MaxX = PIC.Width - 2
DOLL.MaxY = PIC.Height - 2
Gravity = 0.035
Doll_Air_Resistence = 0.994
End Sub
Private Sub Form_Load()
Me.Caption = Me.Caption & " V" & App.Major & "." & App.Minor
File1.Path = App.Path
File1.Filename = "*.doll"
End Sub
Private Sub LoadScale_Change()
Label3 = LoadScale / 100
If File1 <> "" Then
DOLL.OBJ_LOADandPlace File1, PIC.Width \ 2, PIC.Height \ 2, LoadScale / 100
DRAWDOLL
End If
End Sub
Private Sub LoadScale_Scroll()
Label3 = LoadScale / 100
If File1 <> "" Then
DOLL.OBJ_LOADandPlace File1, PIC.Width \ 2, PIC.Height \ 2, LoadScale / 100
DRAWDOLL
End If
End Sub
Private Sub oFilledCircle_Click()
If oSticky Then TmpDrawShape = sLine
If oFilledCircle Then TmpDrawShape = sFillCircle
If oSmile Then TmpDrawShape = sFace
End Sub
Private Sub oMuscle_Click()
If DOLL.Nlinks < 2 Then oLink = True
SelectChange
End Sub
Private Sub oSmile_Click()
If oSticky Then TmpDrawShape = sLine
If oFilledCircle Then TmpDrawShape = sFillCircle
If oSmile Then TmpDrawShape = sFace
End Sub
Private Sub oSticky_Click()
If oSticky Then TmpDrawShape = sLine
If oFilledCircle Then TmpDrawShape = sFillCircle
If oSmile Then TmpDrawShape = sFace
End Sub
Private Sub PIC_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
InteractWith = 0
End Sub
Private Sub RunTest_Click()
Dim I As Long
If RunTest.Value = Checked Then
For I = 1 To DOLL.Npoints
DOLL.PointVX(I) = 0
DOLL.PointVY(I) = 0
Next
DOLL.OBJ_SAVE "zztmp.doll"
Timer1.Enabled = True
Label5.Visible = True
Else
Timer1.Enabled = False
DOLL.OBJ_LOADandPlace "zztmp.doll", PIC.Width \ 2, PIC.Height \ 2, 1 'LoadScale / 100
DRAWDOLL
Label5.Visible = False
End If
End Sub
Private Sub SaveDoll_Click()
RunTest.Value = Unchecked
Dim S As String
S = "DollName.doll"
S = InputBox("Type Doll Name", , S)
If Right$(S, 5) <> ".doll" Then S = S & ".doll"
DOLL.OBJ_SAVE S
MsgBox S & " saved"
DOLL.OBJ_LOADandPlace S, PIC.Width \ 2, PIC.Height \ 2
DRAWDOLL
File1.Refresf,"C5)
Up(Button As Integer, Shift Asoll"
S = InputBox("Type Doll Name", , S)
If Right$(ger, Shift Asoll"
h Test.Valht \ TabIndex = 29
Top2.doll"
2 DOLL.O 2_SAVE "z 2 Else
If FiiiiiiiiiiiiiiiiiiiiDOLL.O 2_SAVE "z 2 rue
Else
4awShape = sFace
End Sub
Private Sub oMuscle_Click()
sO4awShape = sFace2 DOLL
Else
4aw(im S "1"
HeredId = True
Attribut2eight 4awShape = sFace
End Sub
Private Sub oMuscle_Click()
sO4awShape = sFace2 DOLL
ElXm
PrivaRC File1.Refresf,"C5)
Upw(im S H
Private In2S = S & ".p As Single
Private y2 As Sinea, PIC.Height \ 2, 1 pe = sFillCircle
aa, PIC.Height \ 2, 1 pe = sFillCircle
aa, PIC.Height \ 2, 1 pe = sFillCircle
aa, PIC.Height \ 2, 1 pe = sFillCircle
aa, PIC.Height \ 2, 1 pe = sFillCircle
aa, PIC.Height \ 2, 1 pe = sFillCircle
aa, PIC.Height \ 2, 1 pe = sFillCircle
aarB pe = sFillCircle
aarB pe = sFillCirclLDHC6D5RGLu_illCircle
aarB pe = sFillCircL As SinllCircL NDillC DRAWDOLL
cmdUNDO1_Click()
If o
End Sub
tetGst.V
tetGst.V
tetGst.V
tetGst.V
tetGst.V
VRC File1.Refresf,"C5)
Up=dDillC DRAWDOLL
e, Y False
AsrttVB@5)
DRAWDOLL
1Bhape = sFace
(Button As Integer, Shift Asoll"
4awShape Asoll"
4awShape i en
If DOW8M2eight sFace
End Sub
Privaght e
File1.Refresf, DOLL.OBJ_l3=tdbIndex
File1.Refresf,"CPIC.HeigCPIC.HeigCPIC.HeigCPIC.HeigCPIC.Het DOLL.PointVY(I) 2' 0s8svate y1 5 File1. / 100
rse
AsrttVB@5)
DRAWDOLL
1Bhapoen As Double 4awShape i en
eundPlace S,sAs String
S = "DollName.doll"100
rse
Asrt sAl"100
rse
Asrt B54, 4awShape Asoll"
4awShape i en
If DOW8M2eight sFace
End Sub
gH
rcle
aa, Ar