Help with text
Author |
Message |
hackman
|
Posted: Tue Oct 21, 2003 10:48 am Post subject: Help with text |
|
|
Can i make text with a line going straight through it, to make the text look like its been crosed out? If so, whats the code? I have to make a Yahtzee game for comp sci and thought this would add a nice affect. |
|
|
|
|
|
Sponsor Sponsor
|
|
|
Dan
|
Posted: Tue Oct 21, 2003 12:27 pm Post subject: (No subject) |
|
|
well there is no text coamnd for that, but you could use the graifcks comands like Draw.Line to draw a line thougth it after you print it on the screen |
Computer Science Canada
Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more! |
|
|
|
|
Tony
|
Posted: Tue Oct 21, 2003 3:26 pm Post subject: (No subject) |
|
|
if you're using Font.Draw, you can draw another string of
code: |
put repeat("-", length(word))
|
using same coordinates. It should cross it out. |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
|
hackman
|
Posted: Mon Oct 27, 2003 11:03 am Post subject: (No subject) |
|
|
Sorey i took so long to reply. Looks like im gona have to just use drawline.
Tony's idea dosent seem to work on my schools version of turing. Thanks for the replies. |
|
|
|
|
|
Tony
|
Posted: Mon Oct 27, 2003 6:10 pm Post subject: (No subject) |
|
|
repeat is a function and returns a value, not a procedure. You'd have to ether assign value to a variable first or use something like put that assepts a value. I modified the code above. |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
|
hackman
|
Posted: Tue Oct 28, 2003 11:52 am Post subject: (No subject) |
|
|
I still get an 'Expression cannot contain subscripts' error. |
|
|
|
|
|
thoughtful
|
Posted: Tue Oct 28, 2003 5:30 pm Post subject: example |
|
|
Here is an example of wht tony means
code: |
var font : int := Font.New ("verdana:12")
var word : string
var strikeout : string
var x, y := 50
put "Type in the word to be striked out"
get word : *
cls
Font.Draw (word, x, y, font, black)
strikeout := repeat ("-", length (word) + length (word) div 3)
Font.Draw (strikeout, x, y, font, black)
|
|
|
|
|
|
|
thoughtful
|
Posted: Tue Oct 28, 2003 5:36 pm Post subject: Mine |
|
|
I made this program which can strikeout almost ne fontsize and look pretty good
code: |
const fontsize:=40
var font : int := Font.New ("verdana:"+intstr(fontsize))
var word : string
var strikeout : string
var x, y := 50
put "Type in the word to be striked out"
get word : *
cls
Font.Draw (word, x, y, font, black)
strikeout := repeat ("_", length (word)-length(word) div 10)
Font.Draw (strikeout, x, y+(fontsize div 2), font, black)
|
Change the fountsize:= value to change the font size |
|
|
|
|
|
Sponsor Sponsor
|
|
|
hackman
|
Posted: Wed Oct 29, 2003 10:54 am Post subject: (No subject) |
|
|
Ok, now i get it. Thanks. |
|
|
|
|
|
|
|