-
Notifications
You must be signed in to change notification settings - Fork 1
/
Example - Gui empty windows.bb
142 lines (111 loc) · 1.94 KB
/
Example - Gui empty windows.bb
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
;
;
;
Graphics 640,480,16,2
SetBuffer BackBuffer()
Type talkballoon
Field x#,y#,w#,h#
Field txt$
Field style
Field tw,th
End Type
Function newtalkballoon(x,y,w,h,in$,style)
this.talkballoon = New talkballoon
this\x = x
this\y = y
this\w = w
this\h = h
this\style = style
this\txt$ = in$
this\tw = StringWidth(in$)
this\th = StringHeight(in$)
End Function
Function drawtalkballoons()
Local im
For this.talkballoon = Each talkballoon
im = CreateImage(this\w+wm,this\h+hm)
SetBuffer ImageBuffer(im)
Color 200,200,200
Local vx#[10]
Local vy#[10]
Local vw#[10]
Local vh#[10]
vx[0] = 0
vy[0] = 0
vw[0] = 10
vh[0] = 10
vx[1] = this\w-10
vy[1] = 0
vw[1] = 10
vh[1] = 10
vx[2] = 0
vy[2] = this\h-10
vw[2] = 10
vh[2] = 10
vx[3] = this\w-10
vy[3] = this\h-10
vw[3] = 10
vh[3] = 10
Color 200,200,200
For i=0 To 3
Oval vx[i],vy[i],vw[i],vh[i],True
Next
Color 200,200,200
For i=0 To 3
Oval vx[i]+2,vy[i]+2,vw[i]-4,vh[i]-4,True
Next
;Oval 0 ,0 ,10,10,True
;Oval this\w-10 ,0 ,10,10,True
;Oval 0 ,this\h-10 ,10,10,True
;Oval this\w-10 ,this\h-10 ,10,10,True
;Color 0,255,0
vx[0] = 4
vy[0] = 0
vw[0] = this\w-8
vh[0] = 8
vx[1] = 4
vy[1] = this\h-8
vw[1] = this\w-8
vh[1] = this\h
vx[2] = 0
vy[2] = 4
vw[2] = 8
vh[2] = this\h-8
vx[3] = this\w-8
vy[3] = 4
vw[3] = 8
vh[3] = this\h-8
Color 200,200,200
For i=0 To 3
Rect vx[i],vy[i],vw[i],vh[i],True
Next
;Rect 4,0,this\w-8,8,True
;Rect 4,this\h-8,this\w-8,this\h,True
;Rect 0,4,8,this\h-8,True
;Rect this\w-8,4,8,this\h-8,True
;Rect 4,this\h-8,this\w-8,4,True
Select this\style
Case 0
Color 255,255,255
Rect 3,3,this\w-6,this\h-6,True
Case 1
Color 255,255,255
Rect 4,4,this\w-8,this\h-8,True
Case 2
Color 255,255,255
Rect 4,4,this\w-8,this\h-8,True
End Select
SetBuffer BackBuffer()
DrawImage im,this\x,this\y
FreeImage im
Next
End Function
For i=0 To 20
newtalkballoon(Rand(350),Rand(350),Rand(100,200),Rand(100,200),"hey hallo",0)
Next
While KeyDown(1) = False
Cls
drawtalkballoons()
Flip
Wend
End