1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
|
-
|
|
!
-
|
!
-
|
|
-
|
!
-
|
|
|
|
!
-
|
|
|
!
-
|
|
|
!
|
#module
#deffunc m_IniValChgPrbr int a
ddim ac, a
ddim target, a
dim time, a
dim timecnt, a
return
#deffunc m_SetValChgPrbr int _id, double _start, double _target, int _time
id = _id
target.id = _target
time.id = abs(_time) ac.id = (_start - target.id) / (_time*_time)
timecnt.id = 0
return
#defcfunc m_GetValChgPrbrInfo int tid, int infoid
if infoid = 0 {
p = ac.tid * (timecnt.tid - time.tid) * (timecnt.tid - time.tid) + target.tid
return p }
if infoid = 1 {
return time.tid - timecnt.tid
}
return
#defcfunc m_GetValChgPrbr int tid, double def
if time.tid > timecnt.tid {
timecnt.tid++
p = ac.tid * (timecnt.tid - time.tid) * (timecnt.tid - time.tid) + target.tid
} else {
p = def }
return p
#global
m_IniValChgPrbr 256
#if 0
dim tpos, 2 tpos(0) = double(ginfo_winx/2)
tpos(1) = double(ginfo_winy/2)
ddim ppos, 2 ppos(0) = double( tpos(0) )
ppos(1) = double( tpos(1) )
*main
redraw 1 : await 16 : redraw 0 : color 255, 255, 255 : boxf : color : pos 0,0
stick key
if key&256 {
tpos(0) = mousex, mousey
m_SetValChgPrbr 0, ppos(0), double(tpos(0)), 60
m_SetValChgPrbr 1, ppos(1), double(tpos(1)), 60
}
ppos(0) = m_GetValChgPrbr(0, ppos(0))
ppos(1) = m_GetValChgPrbr(1, ppos(1))
pos 10,10
mes "ウィンドウ内をクリックしてください。"
mes "座標("+int(ppos(0))+", "+int(ppos(1))+") - 目標("+tpos(0)+", "+tpos(1)+")"
mes "座標 double("+ppos(0)+", "+ppos(1)+")"
mes "移動終了までの残りカウント:" + m_GetValChgPrbrInfo(0, 1)
mes "現在座標:" + m_GetValChgPrbrInfo(0, 0) + ", " + m_GetValChgPrbrInfo(1, 0)
pos ppos(0), ppos(1) : mes "●" color 255,0,0 : pos tpos(0), tpos(1) : mes "○"
goto *main
#endif
#if 0
tpos = 0
ppos = 0.0
font msmincho, 16
list = "項目1","項目2","項目3","項目4","項目5"
*main
redraw 1 : await 16 : redraw 0 : color 255, 255, 255 : boxf : color : pos 0,0
stick key
if key & 2 {
sct--
if sct<0 : sct=4
m_SetValChgPrbr 0, ppos, double(16*sct), 15
}
if key & 8 {
sct++
if sct>=5 : sct=0
m_SetValChgPrbr 0, ppos, double(16*sct), 15
}
ppos = m_GetValChgPrbr(0, ppos)
pos 100,100
repeat 5
mes list(cnt)
loop
pos 80, 100+ppos : mes "→"
color 255 : pos 100,100+16*sct : mes list(sct)
goto *main
#endif
|