A cordial gift for Kwai chang caine :)
Posted: Fri May 27, 2022 7:07 pm
http://www.purebasic.com
https://www.purebasic.fr/english/
Code: Select all
EnableExplicit
InitSprite()
InitKeyboard()
Global font = LoadFont(#PB_Any,"arial",72,#PB_Font_HighQuality)
Procedure DisplayMessageCenter(window,msg.s,color=255,scale.f=1.00)
Protected spriteNumber,tempImage,fontsTextWidth,fontsTextHeight,cx,cy
tempImage = CreateImage(#PB_Any,1,1) ;if you need to get the size of a font in pixels
If tempImage
If StartDrawing(ImageOutput(tempImage)) ;draw to the temp image
DrawingFont(FontID(font)) ;with the selected font
fontsTextWidth = TextWidth(msg) ;get the width and height in pixles
fontsTextHeight = TextHeight(msg)
StopDrawing()
spriteNumber = CreateSprite(#PB_Any,fontsTextWidth,fontsTextHeight) ;create the sprite of required size
If spriteNumber
If StartDrawing(SpriteOutput(spriteNumber)) ;now you can draw the text to the sprite
DrawingFont(FontID(font))
DrawText(0,0,msg,color)
StopDrawing()
TransparentSpriteColor(spriteNumber,0)
cx= (WindowWidth(window) - (fontsTextWidth*scale)) / 2
cy = (WindowHeight(window)- (fontsTextHeight*scale)) / 2
ZoomSprite(spriteNumber,fontsTextWidth*scale,fontsTextHeight*scale)
DisplayTransparentSprite(spriteNumber,cx,cy)
EndIf
FreeSprite(spriteNumber)
EndIf
EndIf
FreeImage(tempImage)
EndIf
EndProcedure
Global event,ct,sc
OpenWindow(0,0,0,800,600,"Putin de merde clock",#PB_Window_ScreenCentered | #PB_Window_SystemMenu)
OpenWindowedScreen(WindowID(0),0,0,800,600)
Repeat
Repeat
event=WindowEvent()
If event=#PB_Event_CloseWindow
End
EndIf
Until event=0
ExamineKeyboard()
ClearScreen((ct%64)*2)
DisplayMessageCenter(0,FormatDate("%hh:%ii:%ss", Date()-ct),RGB(0,192,0),0.025*sc)
ct+1
sc+1
sc%60
FlipBuffers()
Until KeyboardPushed(#PB_Key_Escape)

My friend wrote:Putin de merde clock


Totally agree, and KCC is my hero hereidle wrote: Sun May 29, 2022 12:23 am Laughter is a good way to stay sane during these times and everyone loves PB's one and only KCC.
Thanks a lot MASTER

Thanks tooPsychophanta wrote:Totally agree, and KCC is my hero here
Reading you, I guess it's been a while since you lost your acne pimples.Psychophanta wrote:Much better than some new ones, at least to my taste


We are thinking that some of any things are essential, as the real shows us the opposite.
https://www.drsearswellnessinstitute.or ... ter-heals/the mister wrote:Laughter Heals the Brain
Not mine he is over trainedOli wrote:that biologically, the skull is too fragile to bear some big laugh


Too far for a little beetleOlli wrote: Thu Jun 02, 2022 9:36 am Lack of laughter does not kill humor. Let's go to the jubilee of "Mother Mature" together...

