Posted: Wed Nov 28, 2007 11:53 am Post subject: Is it possible to get rid of...
I was wondering if it was possible to get rid of the white background behnind the text? am i able to just make it clear?
Sponsor Sponsor
Dan
Posted: Wed Nov 28, 2007 12:46 pm Post subject: RE:Is it possible to get rid of...
No, at least not in the way you are using it.
functions like put where ment for non graphics mode. If you whont text in graphics mode you should use functions like Font.Draw that is a graphical text function.
I think it is Font.Draw, i have not looked it up in some time.
Computer Science CanadaHelp with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
Jestar
Posted: Wed Nov 28, 2007 3:38 pm Post subject: Re: Is it possible to get rid of...
but then how would i do a counter like i am doing in the screenshot for time..?
Dan
Posted: Wed Nov 28, 2007 3:44 pm Post subject: RE:Is it possible to get rid of...
The same way you whould animate an image. It has to be double buffered (view offscreen and view upadate).
Computer Science CanadaHelp with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
Tony
Posted: Wed Nov 28, 2007 3:45 pm Post subject: RE:Is it possible to get rid of...
Say way as you're doing it now. Take the same string you're constructing for put and pass it to Font.Draw(). Look up the documentation for proper usage.
Posted: Wed Nov 28, 2007 3:50 pm Post subject: RE:Is it possible to get rid of...
there both Font.Draw and Draw.Text they work the same and as a added benifit they also come in almost all fonts and sizes(i think all but i put almost just in case)
Jestar
Posted: Wed Nov 28, 2007 3:53 pm Post subject: RE:Is it possible to get rid of...
It does not allow me to use variables in Font.Draw(), could you explain further on how i should go about this?
Nick
Posted: Wed Nov 28, 2007 3:57 pm Post subject: RE:Is it possible to get rid of...
yes yes it does
what is probably happening is you are trying to pass an int through Font.Draw try intstr()
intstr will transform and integer into a string
so:
Font.Draw(intstr(myIntVar),x,y,font,color)
Sponsor Sponsor
Tony
Posted: Wed Nov 28, 2007 3:58 pm Post subject: RE:Is it possible to get rid of...
you are probably using it incorrectly. It's time to show us some code.
Posted: Wed Nov 28, 2007 3:58 pm Post subject: RE:Is it possible to get rid of...
code:
var font1: int
font1 := Font.New ("serif:12")
var hi : string := "HI"
Font.Draw (hi, 50, 30, font1, red)
probably you have to convert your number into string first. using intstr
Jestar
Posted: Wed Nov 28, 2007 4:04 pm Post subject: Re: Is it possible to get rid of...
alright i'll show you some code...this is what it is with the put
code:
put clockhour, ":" ..
if clockmin = 0 then
put clockmin, "0" ..
else
put clockmin ..
end if
View.Update
this is it with Font.Draw
code:
var font1: int
if clockmin = 0 then
font1 := Font.New ("serif:12")
Font.Draw (clockmin, 50, 30, font1, red)
else
Font.Draw (clockmin, 50, 30, font1, red) ..
end if
View.Update
HeavenAgain
Posted: Wed Nov 28, 2007 4:05 pm Post subject: RE:Is it possible to get rid of...
clockmin is an int, which is wrong (i think) should be a String
Jestar
Posted: Wed Nov 28, 2007 4:08 pm Post subject: Re: Is it possible to get rid of...
yes it is a int. but if i set it as a string i cant give it a value...i'm so confused..
Dan
Posted: Wed Nov 28, 2007 4:10 pm Post subject: RE:Is it possible to get rid of...
Font.Draw (intstr(clockmin), 50, 30, font1, red)
intstr should covert ints to strings (i maybe missing some partmatiers, look it up in turing help)
Computer Science CanadaHelp with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
HeavenAgain
Posted: Wed Nov 28, 2007 4:10 pm Post subject: RE:Is it possible to get rid of...
try this
code:
var font1: int
if clockmin = 0 then
font1 := Font.New ("serif:12")
Font.Draw (intstr(clockmin), 50, 30, font1, red)
else
Font.Draw (intstr(clockmin), 50, 30, font1, red) ..
end if
View.Update