background and text blending help
Author |
Message |
Llathe
|
Posted: Wed Nov 30, 2011 6:40 pm Post subject: background and text blending help |
|
|
What is it you are trying to achieve?
I want to have put text on top of a background picture.
I'm very sorry if this has been asked before, i read the tutorial, but the answer wasn't there
What is the problem you are having?
The text creates a white bar. I want the text to be on top of the backgroud.
the image is a .jpg if that helps
Describe what you have tried to solve this problem
I have tried Font.New, it works, but I want it to update.
I also tried all the different modes for the picture.
Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
I know its not much, but i don't think giving code will do much.
Please specify what version of Turing you are using
4.1.1
|
|
|
|
|
|
Sponsor Sponsor
|
|
|
Tony
|
Posted: Wed Nov 30, 2011 6:43 pm Post subject: RE:background and text blending help |
|
|
Font.Draw is likely what you are looking for. Not sure what you mean by "update".
|
Tony's programming blog. DWITE - a programming contest. |
|
|
|
|
Llathe
|
Posted: Wed Nov 30, 2011 6:47 pm Post subject: Re: background and text blending help |
|
|
Sorry for not explaining it properly.
What i have is buttons that change the difficulty for a game I'm making.
I want at the bottom of the menu screen for the difficulty to display.
code: |
loop
exit when GUI.ProcessEvent
locate (20, 20)
put "Difficulty is set to: ", diffucltyDisplay
end loop
|
I did it so that it will update as soon as you change the difficulty
When i do this with font draw it just rewrites the difficulty on top of the old one and looks like a mess.
|
|
|
|
|
|
Tony
|
Posted: Wed Nov 30, 2011 6:57 pm Post subject: RE:background and text blending help |
|
|
well yeah, you should clear the screen (or just that area) first.
The put statement, as you've said "creates a white bar". It would also just mess things up without it.
|
Tony's programming blog. DWITE - a programming contest. |
|
|
|
|
Llathe
|
Posted: Wed Nov 30, 2011 7:10 pm Post subject: Re: background and text blending help |
|
|
I can't seem to get it to work, is it possible for me to PM you the code, so you can have a look for your self?
|
|
|
|
|
|
Tony
|
Posted: Wed Nov 30, 2011 7:16 pm Post subject: RE:background and text blending help |
|
|
no, I don't typically do that.
You could
Tony @ Wed Nov 30, 2011 6:57 pm wrote: well clear the screen (or just that area)
code: |
...
cls
redraw_everything
print_score
...
|
|
Tony's programming blog. DWITE - a programming contest. |
|
|
|
|
Llathe
|
Posted: Wed Nov 30, 2011 7:31 pm Post subject: Re: background and text blending help |
|
|
Sorry for all the trouble.
i tried
code: |
loop
exit when GUI.ProcessEvent
Font.Draw (diffucltyDisplay, 10, 10, text, white)
View.Update
cls
Pic.Draw (background, 0, 0, 0)
menu % menu procedure
end loop
|
The outcome is very flashy, because its looping.
I tried placing
code: |
View.Update
cls
Pic.Draw (background, 0, 0, 0)
menu
|
inside the difficulty button procedure, so that it updates only when it is changed, but then i can't
because the menu procedure comes after the difficulty button procedures.
|
|
|
|
|
|
Tony
|
Posted: Wed Nov 30, 2011 7:34 pm Post subject: RE:background and text blending help |
|
|
do you have offscreenonly set, for View.Update to work?
|
Tony's programming blog. DWITE - a programming contest. |
|
|
|
|
Sponsor Sponsor
|
|
|
Llathe
|
Posted: Wed Nov 30, 2011 7:37 pm Post subject: Re: background and text blending help |
|
|
yes, i have
code: |
View.Set ('offscreeonly, nobuttonbar,')
|
|
|
|
|
|
|
Tony
|
Posted: Wed Nov 30, 2011 7:44 pm Post subject: RE:background and text blending help |
|
|
odd. Try to find a minimal case for which the problem occurs. Is there flashing in
code: |
View.Set("offscreenonly")
...
loop
cls
Pic.Draw (background, 0, 0, 0)
Font.Draw (diffucltyDisplay, 10, 10, text, white)
View.Update
end loop
|
?
|
Tony's programming blog. DWITE - a programming contest. |
|
|
|
|
Llathe
|
Posted: Wed Nov 30, 2011 7:48 pm Post subject: Re: background and text blending help |
|
|
The flashing is still there. I think its even faster, because the : exit when GUI.ProcessEvent was taken out.
|
|
|
|
|
|
Tony
|
Posted: Wed Nov 30, 2011 7:56 pm Post subject: RE:background and text blending help |
|
|
odd. I can't run Turing. Can someone else take a look to verify that this is broken?
|
Tony's programming blog. DWITE - a programming contest. |
|
|
|
|
Llathe
|
Posted: Wed Nov 30, 2011 8:00 pm Post subject: Re: background and text blending help |
|
|
Its not urgent.
A lot of things are placeholders right now.
Here is the source code.
Description: |
|
Download |
Filename: |
mathGame.t |
Filesize: |
4.44 KB |
Downloaded: |
40 Time(s) |
|
|
|
|
|
|
Tony
|
|
|
|
|
Llathe
|
Posted: Wed Nov 30, 2011 8:11 pm Post subject: Re: background and text blending help |
|
|
Oh, I'm sorry for my carelessness. the flashing is gone.
There is another problem now.
I added menu to the loop. Menu isn't appearing.
I'm not completely sure, but i think it is because of the back buffering.
|
|
|
|
|
|
|
|