Computer Science Canada

[Class] Custom Text

Author:  Raknarg [ Mon Aug 06, 2012 6:55 pm ]
Post subject:  [Class] Custom Text

I changed my old custom from a module to a class, so i could use it for other things. I suppose this is more useful than the old one anyways, now you don't get stuck inside a loop while trying to input stuff. Difference now is that once you press enter, it'll send out a signal for one iteration that you have pressed enter. Then it will reset. Do what you will with it.

Note:
x1, y1, x2, y2: coordinates of the "box" you want it to be contained in.
c: font colour
numLines, initText: pretty self explanatory.

Turing:

import "CustomText.tu"

setscreen ("offscreenonly")

var textbox : ^CustomText
new CustomText, textbox

textbox -> initialize (50, 50, 200, 75, black, 2, "Arial", "User: ")
loop
    textbox -> update
    textbox -> draw
    exit when textbox -> textEntered = true
    View.Update
    delay (10)
    cls
end loop

Author:  Raknarg [ Sun Aug 12, 2012 7:36 pm ]
Post subject:  Re: [Class] Custom Text

New version fixes a positioning bug


: