Computer Science Canada

Is it possible to get rid of...

Author:  Jestar [ 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.

Author:  Dan [ 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.

Author:  Jestar [ 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..?

Author:  Dan [ 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).

Author:  Tony [ 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.

Author:  Nick [ 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)

Author:  Jestar [ 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?

Author:  Nick [ 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)

Author:  Tony [ 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.

Author:  HeavenAgain [ 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

Author:  Jestar [ 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

Author:  HeavenAgain [ 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

Author:  Jestar [ 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..

Author:  Dan [ 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)

Author:  HeavenAgain [ 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

Author:  Jestar [ Wed Nov 28, 2007 4:13 pm ]
Post subject:  Re: Is it possible to get rid of...

when i use that it says "Process "day": Variable has no Value.

Author:  HeavenAgain [ Wed Nov 28, 2007 4:20 pm ]
Post subject:  RE:Is it possible to get rid of...

well... Rolling Eyes then it have no value... i do not see the variable in the code you pasted, so im not sure what is going on in your program.

Author:  Jestar [ Wed Nov 28, 2007 4:22 pm ]
Post subject:  Re: Is it possible to get rid of...

code:

var clockmin : int := 0
var clockhour : int := 8


those are the two time variables i am using to make the clock.

Author:  HeavenAgain [ Wed Nov 28, 2007 4:27 pm ]
Post subject:  RE:Is it possible to get rid of...

its not clockmin or hour
its complaining something about a day variable?

Author:  Jestar [ Wed Nov 28, 2007 4:28 pm ]
Post subject:  RE:Is it possible to get rid of...

day is the name of the process that its in.


do you want me to just post the whole process here?

Author:  Jestar [ Wed Nov 28, 2007 4:37 pm ]
Post subject:  RE:Is it possible to get rid of...

ok so this is my process...


code:

process day
    loop
        loop
            cls
            clockmin := clockmin + 10
            if clockmin >= 60 then
                clockmin := 0
                clockhour := clockhour + 1
            end if
            if clockhour > 12 then
                clockhour := 1
                clockhour2 := clockhour2 + 1
            end if
            if clockhour2 not= 2 and maps = 1 then
                Pic.Draw (farmpic, 0, 0, picCopy)
                clockhour2 := 0
            end if
            if clockhour = 7 and maps = 1 then
                Pic.Draw (farmnightpic, 0, 0, picCopy)
                clockhour2 := clockhour2 + 1
            end if
            if clockhour2 = 2 and maps = 1 then
                Pic.Draw (farmnightpic, 0, 0, picCopy)
            end if
            put clockhour, ":" ..
            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
            View.Set ("offscreenonly")
            delay (200)
            exit when clockhour = 12 and clockhour2 = 3
        end loop
        clockhour := 8
        clockmin := 0
        daytime := 0
    end loop
end day

Author:  Nick [ Wed Nov 28, 2007 5:21 pm ]
Post subject:  RE:Is it possible to get rid of...

try
code:
process day
    loop
        end loop
        clockhour := 8
        clockmin := 0
        daytime := 0
        loop
            cls
            clockmin := clockmin + 10
            if clockmin >= 60 then
                clockmin := 0
                clockhour := clockhour + 1
            end if
            if clockhour > 12 then
                clockhour := 1
                clockhour2 := clockhour2 + 1
            end if
            if clockhour2 not= 2 and maps = 1 then
                Pic.Draw (farmpic, 0, 0, picCopy)
                clockhour2 := 0
            end if
            if clockhour = 7 and maps = 1 then
                Pic.Draw (farmnightpic, 0, 0, picCopy)
                clockhour2 := clockhour2 + 1
            end if
            if clockhour2 = 2 and maps = 1 then
                Pic.Draw (farmnightpic, 0, 0, picCopy)
            end if
            put clockhour, ":" ..
            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
            View.Set ("offscreenonly")
            delay (200)
            exit when clockhour = 12 and clockhour2 = 3
    end loop
end day

Author:  Jestar [ Wed Nov 28, 2007 5:32 pm ]
Post subject:  Re: Is it possible to get rid of...

HeavenAgain fixed it for me...thanks for your help though.

Author:  Nick [ Wed Nov 28, 2007 5:35 pm ]
Post subject:  RE:Is it possible to get rid of...

heavenAgain?
he said that its complaining about a varible...

Author:  Jestar [ Wed Nov 28, 2007 5:37 pm ]
Post subject:  Re: Is it possible to get rid of...

we discussed it over PM's Razz

Author:  Nick [ Wed Nov 28, 2007 5:38 pm ]
Post subject:  RE:Is it possible to get rid of...

oh lol then good i thought u misread some names Razz


: