Drawing lines of text... simpel stuff.. help

BlitzMax Forums/BlitzMax Beginners Area/Drawing lines of text... simpel stuff.. help

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

In each of the cases, it seems the only thing you are changing is the Drawtext x position and the "0" or "1". Maybe instead of having all the Select Case you could have a couple functions.

Function Zero()
		SetColor(165,220,225)
		SetAlpha(azero#)
		
		DrawText "0",x#:+30.0,y#
		
		If EventSource() = timer Then ' timer has ticked
		azero# = azero# + azero_var#
			If azero > 1.0 Then azero_var# = -azero_var# ' "ping pong" between getting brighter and getting darker
			If azero < 0.1 Then azero_var# = -azero_var#
		EndIf
End Function

		
Function One()
		SetColor(165,220,225)
		SetAlpha(azero#)
		
		DrawText "1",x#:+30.0,y#
		
		If EventSource() = timer Then ' timer has ticked
		azero# = azero# + azero_var#
			If azero > 1.0 Then azero_var# = -azero_var# ' "ping pong" between getting brighter and getting darker
			If azero < 0.1 Then azero_var# = -azero_var#
		EndIf
End Function


You could even try having a single Type with a drawtext method, but that may be too complicated.