Results 1 to 8 of 8

Thread: The letterings which appears in RPG

  1. #1

    Thread Starter
    Member
    Join Date
    Oct 2000
    Posts
    39
    Hello avid game programmers...!

    Uh... If you had read my last post, then you should know I'm struggling to make a simple RPG game...
    Hope you can help me out in this prob.

    How do you make those wording which appears as though they are being type?
    If you're an avid RPG game player, then you should notice the way they present the text, coming out letters by letters.
    Like mmm... Lufia, Breath of Fire, Tales of Destiny, Suikoden, Final Fantasy Series of course, etc

    Well... I search for ways of doing so and I managed to do something similar with a timer
    But I'm sure the experts out there have something else besides using the timer...
    Please help me out...

    Thanx a lot
    Code:
    <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
    >>  ___      __ ____   ____     _         ____    <<
    >>  \  \    /  / _  | |  __|   | |       |  __|   <<
    >>   \  \  /  / |_| | | |__    | |       | |__    <<
    >>    \  \/  /|  _ <  |__  \   | |       |  __|   <<
    >>     \    / | |_| |  __)  )  | |___  _ | |__    <<
    >>      \__/  |_____| |____/   |_____||_||____|   <<
    >>		      			          <<
    >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
          Visual Basic 5 SP3 Learning Edition.
    
    Sub QuoteOfTheDay()
    If ASCII.ugly = True Then
      WhatTheHeck.ICare = True
    End If
    End Sub

  2. #2
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Easy thing actually, make a UDT for typedtext
    Code:
    Type Typedtext
        Text as string
        Freq as single
        Start as long
        Xpos as integer
        Ypos as integer
    End type
    Then have a frequently called function that draws the text to which you pass a Typedtext UDT to render the text, and return true if the text is fully typed
    Code:
    Function DrawTypedText(TT as typedtext) as boolean
        Pos=(Gettickcount-Start)/Freq
        if Pos>len(Start) then pos=len(start):Drawtypedtext=true
        Text=Left(TT.text,Pos)
        'move to the position and print the Text with the method you want
    End function
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  3. #3

    Thread Starter
    Member
    Join Date
    Oct 2000
    Posts
    39
    Thanks immensely
    but can you give me an example coz i tried the examples you've shown...
    however, it didn't work much
    so...
    my email is [email protected]
    thanks a lot
    Code:
    <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
    >>  ___      __ ____   ____     _         ____    <<
    >>  \  \    /  / _  | |  __|   | |       |  __|   <<
    >>   \  \  /  / |_| | | |__    | |       | |__    <<
    >>    \  \/  /|  _ <  |__  \   | |       |  __|   <<
    >>     \    / | |_| |  __)  )  | |___  _ | |__    <<
    >>      \__/  |_____| |____/   |_____||_||____|   <<
    >>		      			          <<
    >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
          Visual Basic 5 SP3 Learning Edition.
    
    Sub QuoteOfTheDay()
    If ASCII.ugly = True Then
      WhatTheHeck.ICare = True
    End If
    End Sub

  4. #4
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Ok sorry i didn't have vb last time so i couldn't test my code. Now this example should work.
    Place this in a module
    Code:
    Declare Function GetTickCount Lib "kernel32" () As Long
    
    Type Typedtext
        text As String
        Freq As Single
        Start As Long
        Xpos As Integer
        Ypos As Integer
    End Type
    
    Function DrawTypedText(TT As Typedtext) As Boolean
        Dim pos As Long
        With TT
            pos = (GetTickCount - .Start) * .Freq / 1000
            If pos > Len(.text) Then pos = Len(.text): DrawTypedText = True
            If pos > 0 Then
                text = Left(.text, pos)
                Form1.CurrentX = .Xpos
                Form1.CurrentY = .Ypos
                Form1.Print text
            End If
        End With
    End Function
    And this on a form with a command buton, try change the values and see what happens
    Code:
    Private Sub Command1_Click()
        Dim example As Typedtext
        With example
            .Freq = 10
            .Start = GetTickCount + 500
            .text = "THIS IS EXAMPLE TEXT"
            .Xpos = 500
            .Ypos = 500
        End With
        Do
            DoEvents
        Loop Until DrawTypedText(example)
    
    End Sub
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  5. #5

    Thread Starter
    Member
    Join Date
    Oct 2000
    Posts
    39

    Talking

    WOW!!!
    Thanks a lot!!!
    It work just nice...!
    One last questions though...
    Can you make something similar in a label or textbox rather than specifying the text to appear on certain position on the form...
    It's kinda troublesome...

    Anyway, thanks a lot

    Regards
    Code:
    <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
    >>  ___      __ ____   ____     _         ____    <<
    >>  \  \    /  / _  | |  __|   | |       |  __|   <<
    >>   \  \  /  / |_| | | |__    | |       | |__    <<
    >>    \  \/  /|  _ <  |__  \   | |       |  __|   <<
    >>     \    / | |_| |  __)  )  | |___  _ | |__    <<
    >>      \__/  |_____| |____/   |_____||_||____|   <<
    >>		      			          <<
    >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
          Visual Basic 5 SP3 Learning Edition.
    
    Sub QuoteOfTheDay()
    If ASCII.ugly = True Then
      WhatTheHeck.ICare = True
    End If
    End Sub

  6. #6
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    ah, not a problem
    change this:
    Code:
    text = Left(.text, pos)
    Form1.CurrentX = .Xpos
    Form1.CurrentY = .Form1.Print text
    to this:
    Code:
    text = Left(.text, pos)
    label1=text
    remember, if you want you could set the label to autoresize while you do this, and it will take the size while typing, but if you want to keep the multilines, then don't.
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  7. #7

    Thread Starter
    Member
    Join Date
    Oct 2000
    Posts
    39

    Talking

    Thank!!!
    You're certainly an expert!
    I guess that's it...
    Thanks a lot
    Please help me next time, will you?
    Btw, what is kedaman?

    Regards
    Code:
    <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
    >>  ___      __ ____   ____     _         ____    <<
    >>  \  \    /  / _  | |  __|   | |       |  __|   <<
    >>   \  \  /  / |_| | | |__    | |       | |__    <<
    >>    \  \/  /|  _ <  |__  \   | |       |  __|   <<
    >>     \    / | |_| |  __)  )  | |___  _ | |__    <<
    >>      \__/  |_____| |____/   |_____||_||____|   <<
    >>		      			          <<
    >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
          Visual Basic 5 SP3 Learning Edition.
    
    Sub QuoteOfTheDay()
    If ASCII.ugly = True Then
      WhatTheHeck.ICare = True
    End If
    End Sub

  8. #8
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Sure i'll help you whenever i can. kedaman, that's my name ,not my real one, my member name
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width