Hi,
Da ich momentan ein kleines Konkurrenzprojekt zu singu's [Release] TextEffectsLib erstelle, wollte ich mal einen kleinen Teil davon Open Source machen.
Hier findet ihr zahlreich viele Effekte, und es kommen noch mehr dazu.
Da ich momentan ein kleines Konkurrenzprojekt zu singu's [Release] TextEffectsLib erstelle, wollte ich mal einen kleinen Teil davon Open Source machen.
Hier findet ihr zahlreich viele Effekte, und es kommen noch mehr dazu.
VB.NET-Quellcode
- Public Sub typewriter(ByVal target As Control, ByVal txt As String, ByVal speed As Integer, ByVal typechar As String)
- Dim Array1 As String
- Dim ltext As String = ""
- Array1 = txt.ToCharArray
- For i As Integer = 0 To txt.Length - 1
- ltext += Array1(i)
- target.Text = ltext + typechar
- Application.DoEvents()
- Threading.Thread.Sleep(speed)
- Next
- target.Text = txt
- End Sub
- Public Sub InFormLeft(ByVal target As Control, ByVal txt As String, ByVal speed As Integer)
- Dim Array1 As String
- Dim ltext As String = ""
- Array1 = txt.ToCharArray
- For i As Integer = 0 To txt.Length - 1
- ltext = Array1((txt.Length - 1) - i) + ltext
- target.Text = ltext
- Application.DoEvents()
- Threading.Thread.Sleep(speed)
- Next
- target.Text = txt
- End Sub
- Public Sub InFormRight(ByVal target As Control, ByVal txt As String, ByVal speed As Integer)
- Dim Array1 As String
- Dim ltext As String = ""
- Dim Pattern As String = ""
- Array1 = txt.ToCharArray
- Do Until Pattern.Length = txt.Length
- Pattern += " "
- Loop
- For i As Integer = 0 To txt.Length - 1
- Pattern = Pattern.Remove(txt.Length - (i + 1), 1)
- ltext += Array1(i)
- target.Text = Pattern + ltext
- Application.DoEvents()
- Threading.Thread.Sleep(speed)
- Next
- target.Text = txt
- End Sub
- Public Sub OutFromLeft(ByVal target As Control, ByVal txt As String, ByVal speed As Integer)
- Dim ltext As String = txt
- target.Text = txt
- For i As Integer = 0 To txt.Length - 1
- ltext = ltext.Remove(0, 1)
- target.Text = ltext
- Application.DoEvents()
- Threading.Thread.Sleep(speed)
- Next
- End Sub
- Public Sub OutFromRight(ByVal target As Control, ByVal txt As String, ByVal speed As Integer)
- Dim ltext As String = txt
- Dim Pattern As String = ""
- target.Text = txt
- For i As Integer = 0 To txt.Length - 1
- ltext = ltext.Remove(ltext.Length - 1, 1)
- Pattern += " "
- target.Text = Pattern + ltext
- Application.DoEvents()
- Threading.Thread.Sleep(speed)
- Next
- End Sub
- Public Sub HideFromLeft(ByVal target As Control, ByVal txt As String, ByVal speed As Integer)
- Dim ltext As String = txt
- Dim Pattern As String = ""
- target.Text = txt
- For i As Integer = 0 To txt.Length - 1
- ltext = ltext.Remove(0, 1)
- Pattern += " "
- target.Text = Pattern + ltext
- Application.DoEvents()
- Threading.Thread.Sleep(speed)
- Next
- End Sub
- Public Sub HideFromRight(ByVal target As Control, ByVal txt As String, ByVal speed As Integer)
- Dim ltext As String = txt
- target.Text = txt
- For i As Integer = 0 To txt.Length - 1
- ltext = ltext.Remove(ltext.Length - 1, 1)
- target.Text = ltext
- Application.DoEvents()
- Threading.Thread.Sleep(speed)
- Next
- End Sub
- Public Sub ExpandEffect(ByVal target As Control, ByVal txt As String, ByVal speed As Integer, ByVal expander As String)
- Dim Array1 As String
- Dim ltext As String = ""
- Dim stext As String = txt
- Array1 = txt.ToCharArray
- For i As Integer = 0 To txt.Length - 1
- ltext += Array1(i) + expander
- stext = stext.Remove(0, 1)
- target.Text = ltext + stext
- Application.DoEvents()
- Threading.Thread.Sleep(speed)
- Next
- Threading.Thread.Sleep(800)
- Dim first As Boolean = True
- Array1 = target.Text.ToCharArray
- Dim lS As String = target.Text
- For i As Integer = 0 To target.Text.Length - 1
- If first = True Then
- lS = lS.Remove((Array1.Length - 1) - i, 1)
- first = False
- Else
- first = True
- End If
- target.Text = lS
- Application.DoEvents()
- Threading.Thread.Sleep(speed)
- Next
- End Sub