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

Username:   Password: 
 RegisterRegister   
 Is it possible to get rid of...
Index -> Programming, Turing -> Turing Help
Goto page 1, 2  Next
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Jestar




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

Posted Image, might have been reduced in size. Click Image to view fullscreen.
Sponsor
Sponsor
Sponsor
sponsor
Dan




PostPosted: 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 Canada Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
Jestar




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




PostPosted: 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 Canada Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
Tony




PostPosted: 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.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Nick




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




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




PostPosted: 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
Sponsor
sponsor
Tony




PostPosted: 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.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
HeavenAgain




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




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




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




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




PostPosted: 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 Canada Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
HeavenAgain




PostPosted: 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
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 2  [ 26 Posts ]
Goto page 1, 2  Next
Jump to:   


Style:  
Search: