@@ -249,7 +249,7 @@ return Class {
249
249
self .ubob_frame = (self .ubob_frame + 1 % screen_size .ANIM_STRIPEb )
250
250
self .ubob_offset_phase = self .ubob_offset_phase + 120.0 * self .dt
251
251
self .ubob_scale = self .ubob_scale + self .dt * 1.5
252
- return not has_ended ()
252
+ return not has_ended ()
253
253
end ,
254
254
255
255
clear_playfield = function (self , from_top )
@@ -292,40 +292,40 @@ return Class {
292
292
end ,
293
293
294
294
render_demo_text = function (self )
295
- local text_duration = # (font_desc .demo_string [self .current_text_idx + 1 ])* 0.05
296
- local fade_duration = 0.2
297
- if self .current_text_idx ==- 1 or self .text_display_timer > text_duration then
298
- self .text_display_timer = 0.0
299
- self .current_text_idx = self .current_text_idx + 1
300
- if self .current_text_idx >=# font_desc .demo_string then
301
- self .current_text_idx = 0
302
- end
303
- local text_string = font_desc .demo_string [self .current_text_idx ]
304
- self .text_pixel_w = self . font_writer_blit (self .pictures [' font_sans_serif' ], self .text_buffer , 0 , 0 , text_string )
305
- end
306
- self .text_display_timer = self .text_display_timer + self .dt * 0.5
307
- local opacity
308
- if self .text_display_timer < fade_duration then
309
- opacity = Clamp (RangeAdjust (self .text_display_timer , 0.0 , fade_duration , 0.0 , 1.0 ), 0.0 , 1.0 )
310
- elseif self .text_display_timer > text_duration - fade_duration then
311
- opacity = Clamp (RangeAdjust (self .text_display_timer , text_duration - fade_duration , text_duration , 1.0 , 0.0 ), 0.0 , 1.0 )
312
- else
313
- opacity = 1.0
314
- end
315
- opacity = Quantize (opacity , 8 )
316
- local dest_rect = self .text_buffer :GetRect ()
317
- dest_rect :SetHeight (screen_size .DISPL_HEIGHT3 )
318
- local dest_rect_offset = dest_rect :Offset (0 , screen_size .DISPL_HEIGHT1 )
319
- dest_rect_offset :SetHeight (screen_size .DISPL_HEIGHT3 + 1 )
320
- self .screen_pic :SetFillColorRGBA (screen_size .COLOUR_PURPLE .r * 1.5 , screen_size .COLOUR_PURPLE .g * 1.5 , screen_size .COLOUR_PURPLE .b * 1.5 , 1.0 )
321
- self .screen_pic :SetFillMode (hg .BrushSolid )
322
- self .screen_pic :SetPenMode (hg .PenNone )
323
- self .screen_pic :DrawRect (dest_rect_offset .sx , dest_rect_offset .sy , dest_rect_offset .ex , dest_rect_offset .ey )
324
- self .screen_pic :Blit (self .text_buffer , dest_rect , hg .IntVector2 (math.floor ((screen_size .WIDTH3 - self .text_pixel_w )/ 2.0 ), screen_size .DISPL_HEIGHT1 + 1 ))
325
- if opacity < 1.0 then
326
- self .screen_pic :SetFillColorRGBA (screen_size .COLOUR_PURPLE .r * 1.5 , screen_size .COLOUR_PURPLE .g * 1.5 , screen_size .COLOUR_PURPLE .b * 1.5 , 1.0 - opacity )
327
- self .screen_pic :DrawRect (dest_rect_offset .sx , dest_rect_offset .sy , dest_rect_offset .ex , dest_rect_offset .ey )
328
- end
295
+ -- local text_duration = #(font_desc.demo_string[self.current_text_idx + 1])*0.05
296
+ -- local fade_duration = 0.2
297
+ -- if self.current_text_idx==-1 or self.text_display_timer>text_duration then
298
+ -- self.text_display_timer = 0.0
299
+ -- self.current_text_idx = self.current_text_idx+1
300
+ -- if self.current_text_idx>=#font_desc.demo_string then
301
+ -- self.current_text_idx = 0
302
+ -- end
303
+ -- local text_string = font_desc.demo_string[self.current_text_idx]
304
+ -- self.text_pixel_w = self: font_writer_blit(self.pictures['font_sans_serif'], self.text_buffer, 0, 0, text_string)
305
+ -- end
306
+ -- self.text_display_timer = self.text_display_timer+self.dt*0.5
307
+ -- local opacity
308
+ -- if self.text_display_timer<fade_duration then
309
+ -- opacity = Clamp(RangeAdjust(self.text_display_timer, 0.0, fade_duration, 0.0, 1.0), 0.0, 1.0)
310
+ -- elseif self.text_display_timer>text_duration-fade_duration then
311
+ -- opacity = Clamp(RangeAdjust(self.text_display_timer, text_duration-fade_duration, text_duration, 1.0, 0.0), 0.0, 1.0)
312
+ -- else
313
+ -- opacity = 1.0
314
+ -- end
315
+ -- opacity = Quantize(opacity, 8)
316
+ -- local dest_rect = self.text_buffer:GetRect()
317
+ -- dest_rect:SetHeight(screen_size.DISPL_HEIGHT3)
318
+ -- local dest_rect_offset = dest_rect:Offset(0, screen_size.DISPL_HEIGHT1)
319
+ -- dest_rect_offset:SetHeight(screen_size.DISPL_HEIGHT3+1)
320
+ -- self.screen_pic:SetFillColorRGBA(screen_size.COLOUR_PURPLE.r*1.5, screen_size.COLOUR_PURPLE.g*1.5, screen_size.COLOUR_PURPLE.b*1.5, 1.0)
321
+ -- self.screen_pic:SetFillMode(hg.BrushSolid)
322
+ -- self.screen_pic:SetPenMode(hg.PenNone)
323
+ -- self.screen_pic:DrawRect(dest_rect_offset.sx, dest_rect_offset.sy, dest_rect_offset.ex, dest_rect_offset.ey)
324
+ -- self.screen_pic:Blit(self.text_buffer, dest_rect, hg.IntVector2(math.floor((screen_size.WIDTH3-self.text_pixel_w)/2.0), screen_size.DISPL_HEIGHT1+1))
325
+ -- if opacity<1.0 then
326
+ -- self.screen_pic:SetFillColorRGBA(screen_size.COLOUR_PURPLE.r*1.5, screen_size.COLOUR_PURPLE.g*1.5, screen_size.COLOUR_PURPLE.b*1.5, 1.0-opacity)
327
+ -- self.screen_pic:DrawRect(dest_rect_offset.sx, dest_rect_offset.sy, dest_rect_offset.ex, dest_rect_offset.ey)
328
+ -- end
329
329
end ,
330
330
331
331
font_writer_blit = function (self , font_picture , dest_picture , x , y , text_string )
@@ -342,11 +342,11 @@ return Class {
342
342
end
343
343
local i = 0
344
344
local cur_x = x
345
- y = y + screen_size .DISPL_HEIGHT1
346
- local text_string = list (text_string )
345
+ y = y + screen_size .DISPL_HEIGHT1
346
+ local text_string = stringToList (text_string )
347
347
dest_picture .ClearRGBA (screen_size .COLOUR_PURPLE .r * 1.5 , screen_size .COLOUR_PURPLE .g * 1.5 , screen_size .COLOUR_PURPLE .b * 1.5 , 1.0 )
348
348
while i <# text_string do
349
- if text_string [i ] == ' ' then
349
+ if text_string [i + 1 ] == ' ' then
350
350
cur_x = cur_x + 4
351
351
end
352
352
local glyph_index = font_glyph_find_index (text_string [i ], font_desc .tiny_font [' glyph' ])
0 commit comments