@@ -146,58 +146,49 @@ Function LoadBitmapFont(scale = 1.0 as float) As Dynamic
146146 return this
147147End Function
148148
149- Function write_text (screen as object , text as string , x as integer , y as integer ) as object
149+ Function write_text (screen as object , text as string , x as integer , y as integer , redraw = false as boolean ) as object
150150 xOff = 2 * m .scale
151151 yOff = 8 * m .scale
152152 for c = 0 to len (text ) - 1
153153 ci = asc (text .mid (c ,1 ))
154154 'Convert accented characters not supported by the font
155- if ci > 191 and ci < 199
155+ if ( ci > 191 and ci < 199 ) or ( ci > 223 and ci < 231 ) 'A
156156 ci = 65
157- else if ci = 199
157+ else if ci = 199 or ci = 231 'C
158158 ci = 67
159- else if ci > 199 and ci < 204
159+ else if ( ci > 199 and ci < 204 ) or ( ci > 231 and ci < 236 ) 'E
160160 ci = 69
161- else if ci > 203 and ci < 208
161+ else if ( ci > 203 and ci < 208 ) or ( ci > 235 and ci < 240 ) 'I
162162 ci = 73
163- else if ci = 208
163+ else if ci = 208 'D
164164 ci = 68
165- else if ci = 209
165+ else if ci = 209 or ci = 241 'N
166166 ci = 78
167- else if ci > 209 and ci < 215
167+ else if ( ci > 209 and ci < 215 ) or ( ci > 241 and ci < 247 ) 'O
168168 ci = 79
169- else if ci = 215
170- ci = 120
171- else if ci = 216
169+ else if ci = 215 'X
170+ ci = 88
171+ else if ci = 216 '0
172172 ci = 48
173- else if ci > 216 and ci < 221
173+ else if ( ci > 216 and ci < 221 ) or ( ci > 248 and ci < 253 ) 'U
174174 ci = 85
175- else if ci = 221
175+ else if ci = 221 'Y
176176 ci = 89
177- else if ci > 223 and ci < 231
178- ci = 97
179- else if ci = 231
180- ci = 99
181- else if ci > 231 and ci < 236
182- ci = 101
183- else if ci > 235 and ci < 240
184- ci = 105
185- else if ci = 240
186- ci = 100
187- else if ci = 241
188- ci = 110
189- else if ci > 241 and ci < 247
190- ci = 111
191- else if ci > 248 and ci < 253
192- ci = 117
193177 else if ci > 160
194178 ci = 32
195179 end if
196180 'write the letter
197181 letter = m .chars .Lookup ("chr" + itostr (ci ))
198182 if letter <> invalid
199183 yl = y + (yOff - letter .image .GetHeight ())
200- screen .drawobject (x , yl + letter .yOffset , letter .image )
184+ if not redraw
185+ screen .drawobject (x , yl + letter .yOffset , letter .image )
186+ else
187+ bmp = CreateObject ("roBitmap " , {width :letter .GetWidth (), height :letter .GetHeight (), alphaenable :true })
188+ bmp .Clear (m .colors .black )
189+ bmp .DrawObject (0 , 0 , letter )
190+ screen .DrawObject (x , yl + letter .yOffset , bmp )
191+ end if
201192 x += (letter .image .GetWidth () + xOff )
202193 end if
203194 next
0 commit comments