Merry Christmas!

For everything that's not in any way related to PureBasic. General chat etc...
User avatar
TI-994A
Addict
Addict
Posts: 2512
Joined: Sat Feb 19, 2011 3:47 am
Location: Singapore
Contact:

Merry Christmas!

Post by TI-994A »

Image
Texas Instruments TI-99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too! Please visit my YouTube Channel :D
BarryG
Addict
Addict
Posts: 3331
Joined: Thu Apr 18, 2019 8:17 am

Re: Merry Christmas!

Post by BarryG »

Merry Christmas, too! :D
box_80
Enthusiast
Enthusiast
Posts: 113
Joined: Mon Sep 03, 2012 8:52 pm

Re: Merry Christmas!

Post by box_80 »

Happy holidays everyone. :mrgreen:
Last edited by box_80 on Wed Dec 25, 2019 8:51 pm, edited 1 time in total.
User avatar
VB6_to_PBx
Enthusiast
Enthusiast
Posts: 626
Joined: Mon May 09, 2011 9:36 am

Re: Merry Christmas!

Post by VB6_to_PBx »

Merry Christmas !!!
 
PureBasic .... making tiny electrons do what you want !

"With every mistake we must surely be learning" - George Harrison
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8434
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Re: Merry Christmas!

Post by netmaestro »

Merry Christmas to all and to all a "Code Tight"!
BERESHEIT
User avatar
kenmo
Addict
Addict
Posts: 1967
Joined: Tue Dec 23, 2003 3:54 am

Re: Merry Christmas!

Post by kenmo »

Enjoy the holidays, everyone, get some deserved rest, and look forward to 2020 :D
User avatar
Michael Vogel
Addict
Addict
Posts: 2680
Joined: Thu Feb 09, 2006 11:27 pm
Contact:

Re: Merry Christmas!

Post by Michael Vogel »

Code: Select all

; Define
	#Text="Merry Christmas!"
	#FontName="Segoe UI"
	#FontSize=80
	#FontType=#PB_Font_Bold|#PB_Font_Italic

	#WX=900
	#WY=200

	#FX=10
	#FY=20

	#Pen=		3

	#ColBack=	$FFFFC0
	#ColBorder=	#Black
	#ColFill=		#Yellow
	#ColSnow=	#White
	#ColShadow=#Black

	#Draw=		$FF000000
	#Color=		$00FFFFFF

	Global Dim Snow(#WX)
	Global Dim Cloud.Rect(0)

; EndDefine

Procedure Init()

	LoadFont (0,#FontName,#FontSize,#FontType)

	OpenWindow(0,0,0,#WX,#WY,"Snowy Font by Michael Vogel",#PB_Window_SystemMenu|#PB_Window_ScreenCentered)
	CanvasGadget(0,0,0,#WX,#WY)

	CreateImage(0,#WX,#WY,32,#Red)
	StartDrawing(ImageOutput(0))
	DrawingMode(#PB_2DDrawing_AllChannels)
	Box(0,0,#WX,#WY,#ColBack)
	StopDrawing()

	CompilerIf 0
		StartDrawing(ImageOutput(0))
		DrawingFont(FontID(0))
		DrawingMode(#PB_2DDrawing_AlphaBlend|#PB_2DDrawing_Transparent)
		DrawText(#FX,#FY,#Text,#Draw|#ColFill,0)
		StopDrawing()

	CompilerElse
		StartVectorDrawing(ImageVectorOutput(0))
		VectorFont(FontID(0))
		MovePathCursor(#FX,#FY)
		AddPathText(#Text)
		VectorSourceColor(#Draw|#ColBorder)
		StrokePath(#Pen+3,#PB_Path_Preserve|#PB_Path_RoundCorner)
		VectorSourceColor(#Draw|#ColFill)
		FillPath(#PB_Path_Preserve)
		StopVectorDrawing()

	CompilerEndIf

EndProcedure
Procedure Snowcloud(x,y,w,h)
	
	; Work in process... (shapes need to be polished a little bit)
	
	If w>5

		If w<46

			TranslateCoordinates(x,y-15)
			ScaleCoordinates(w/800,0.05)
			MovePathCursor(33,327)
			AddPathCurve(20,359,33,359,59,366)
			AddPathCurve(151,399,184,353,243,372)
			AddPathCurve(308,405,341,425,420,399)
			AddPathCurve(485,379,518,346,590,366)
			AddPathCurve(656,386,695,379,741,340)
			AddPathCurve(780,300,695,274,669,261)
			AddPathCurve(603,235,524,215,459,215)
			AddPathCurve(420,222,393,228,354,228)
			AddPathCurve(249,235,99,228,33,327)
			ClosePath()
			VectorSourceColor($FFFEFEFE)
			FillPath(#PB_Path_Preserve)
			ResetCoordinates()
			VectorSourceColor($FF292A2B)
			StrokePath(2.7,#PB_Path_RoundCorner|#PB_Path_RoundEnd)

		Else
			TranslateCoordinates(x-12,y-12)
			ScaleCoordinates(w/600,0.07)
			
			MovePathCursor(251,499)
			AddPathCurve(232,462,220,462,178,475)
			AddPathCurve(159,480,121,499,107,512)
			AddPathCurve(93,528,83,561,110,566)
			AddPathCurve(131,570,153,570,173,573)
			AddPathCurve(207,580,195,580,224,572)
			AddPathCurve(246,565,249,568,259,543)
			AddPathCurve(266,524,259,517,251,499)
			ClosePath()
			VectorSourceColor($FFFEFEFE)
			FillPath(#PB_Path_Preserve)
			ResetCoordinates()
			VectorSourceColor($FF292A2B)
			StrokePath(2.7,#PB_Path_RoundCorner|#PB_Path_RoundEnd)

			TranslateCoordinates(x-12,y-12)
			ScaleCoordinates(w/600,0.07)
			MovePathCursor(178,35)
			AddPathCurve(85,103,163,253,175,341)
			AddPathCurve(176,365,178,387,180,411)
			AddPathCurve(180,419,181,455,193,455)
			AddPathCurve(214,455,212,436,214,418)
			AddPathCurve(222,372,278,341,247,275)
			AddPathCurve(234,243,193,235,215,211)
			AddPathCurve(291,125,476,159,562,98)
			AddPathCurve(586,81,559,72,535,67)
			AddPathCurve(456,54,398,30,313,25)
			AddPathCurve(278,22,212,20,178,35)
			ClosePath()
			VectorSourceColor($FF241EE3)
			FillPath(#PB_Path_Preserve)
			ResetCoordinates()
			VectorSourceColor($FF292A2B)
			StrokePath(2.7,#PB_Path_RoundCorner|#PB_Path_RoundEnd)

			TranslateCoordinates(x-12,y-12)
			ScaleCoordinates(w/600,0.07)
			MovePathCursor(210,211)
			AddPathCurve(203,226,219,259,224,272)
			AddPathCurve(236,301,251,287,258,314)
			AddPathCurve(264,330,259,301,293,308)
			AddPathCurve(320,311,302,313,325,301)
			AddPathCurve(357,284,403,270,440,267)
			AddPathCurve(466,267,442,257,474,255)
			AddPathCurve(544,252,535,223,571,220)
			AddPathCurve(601,216,604,220,635,206)
			AddPathCurve(655,198,675,186,696,177)
			AddPathCurve(721,165,719,160,736,138)
			AddPathCurve(750,120,758,108,745,84)
			AddPathCurve(726,54,703,64,675,45)
			AddPathCurve(650,28,625,52,601,66)
			AddPathCurve(576,79,564,79,540,100)
			AddPathCurve(508,122,494,115,457,125)
			AddPathCurve(418,135,393,140,352,147)
			AddPathCurve(313,154,232,171,212,206)
			AddPathLine(210,211)
			ClosePath()
			VectorSourceColor($FFFEFEFE)
			FillPath(#PB_Path_Preserve)
			ResetCoordinates()
			VectorSourceColor($FF292A2B)
			StrokePath(2.7,#PB_Path_RoundCorner|#PB_Path_RoundEnd)

		EndIf

	EndIf


EndProcedure
Procedure Snowstorm()

	Protected a,b
	Protected x,y,z

	StartDrawing(ImageOutput(0))
	DrawingFont(FontID(0))

	While x<#WX
		While y<#WY
			If Point(x,y)&#Color=#ColBorder
				Snow(x)=y
				;Box(x,0,1,y,#Blue)
				y=#WY
			Else
				y+1
			EndIf
		Wend
		x+1
		y=0
	Wend

	;DrawingMode(#PB_2DDrawing_AlphaBlend)
	;DrawText(#FX,#FY,#Text,#Draw|#ColFill,0)
	StopDrawing()
	
	
	StartVectorDrawing(ImageVectorOutput(0))
	; Work in process (recognizing the best places for the snow should be optimized)
	
	x=0
	y=0
	z=0
	While x<#WX
		;Debug Str(x)+": "+Str(snow(x))
		y=Snow(x)
		If y
			If z=0
				a=x
				b=y
				z=1
			ElseIf Abs(b-y)>5
				Snowcloud(a-1,Snow((a+x)/2),x-a+2,5)
				z=0
			EndIf
		Else
			If a>0
				Snowcloud(a-1,Snow((a+x)/2),x-a+2,5)
				a=0
			EndIf
			z=0
		EndIf
		x+1
	Wend



	StopVectorDrawing()


EndProcedure
Procedure Main()

	Init()
	Snowstorm()

	StartDrawing(CanvasOutput(0))
	DrawImage(ImageID(0),0,0)
	;DrawAlphaImage(ImageID(0),1,1)
	StopDrawing()

	Repeat
		Select WaitWindowEvent()
		Case #PB_Event_CloseWindow,#WM_CHAR
			End
		EndSelect
	ForEver

EndProcedure
Main()
User avatar
Kurzer
Enthusiast
Enthusiast
Posts: 666
Joined: Sun Jun 11, 2006 12:07 am
Location: Near Hamburg

Re: Merry Christmas!

Post by Kurzer »

Better late than never: :lol:

I wish you all a merry christmas (or rather that you had a merry christmas) and as a precaution a happy new year right after. :-)

Kurzer

@Michael Vogel: Nice Code, thank you! On a display with > 96 dpi resolution the constant #WX have to be adjustet. Otherwise the text is not displayed fully. ;-)
PB 6.02 x64, OS: Win 7 Pro x64 & Win 11 x64, Desktopscaling: 125%, CPU: I7 6500, RAM: 16 GB, GPU: Intel Graphics HD 520, User age in 2024: 56y
"Happiness is a pet." | "Never run a changing system!"
User avatar
VB6_to_PBx
Enthusiast
Enthusiast
Posts: 626
Joined: Mon May 09, 2011 9:36 am

Re: Merry Christmas!

Post by VB6_to_PBx »

Michael Vogel ,

remarkable effect for such a small amount of Code !

Merry Christmas !!!
 
PureBasic .... making tiny electrons do what you want !

"With every mistake we must surely be learning" - George Harrison
Fred
Administrator
Administrator
Posts: 16690
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: Merry Christmas!

Post by Fred »

Merry Christmas everybody !!
Post Reply