Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 [Class] Custom Text
Index -> Programming, Turing -> Turing Submissions
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Raknarg




PostPosted: 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



CustomText.tu
 Description:

Download
 Filename:  CustomText.tu
 Filesize:  5.9 KB
 Downloaded:  226 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
Raknarg




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

New version fixes a positioning bug


CustomText.tu
 Description:

Download
 Filename:  CustomText.tu
 Filesize:  6 KB
 Downloaded:  200 Time(s)

Display posts from previous:   
   Index -> Programming, Turing -> Turing Submissions
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 2 Posts ]
Jump to:   


Style:  
Search: