
-----------------------------------
Llathe
Wed Nov 30, 2011 6:40 pm

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)




Pic.Draw (background, 0, 0, 0)


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

-----------------------------------
Tony
Wed Nov 30, 2011 6:43 pm

RE:background and  text blending help
-----------------------------------
[tdoc]Font.Draw[/tdoc] is likely what you are looking for. Not sure what you mean by "update".

-----------------------------------
Llathe
Wed Nov 30, 2011 6:47 pm

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
[/code]
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
Wed Nov 30, 2011 6:57 pm

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.

-----------------------------------
Llathe
Wed Nov 30, 2011 7:10 pm

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? :oops:

-----------------------------------
Tony
Wed Nov 30, 2011 7:16 pm

RE:background and  text blending help
-----------------------------------
no, I don't typically do that.

You could
well clear the screen (or just that area)
[code]
...
cls
redraw_everything
print_score
...
[/code]

-----------------------------------
Llathe
Wed Nov 30, 2011 7:31 pm

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
[/code]

The outcome is very flashy, because its looping.
I tried placing
[code]
    View.Update 
    cls
    Pic.Draw (background, 0, 0, 0)
    menu
[/code]
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
Wed Nov 30, 2011 7:34 pm

RE:background and  text blending help
-----------------------------------
do you have offscreenonly set, for View.Update to work?

-----------------------------------
Llathe
Wed Nov 30, 2011 7:37 pm

Re: background and  text blending help
-----------------------------------
yes, i have
[code]
View.Set ('offscreeonly, nobuttonbar,')
[/code]

-----------------------------------
Tony
Wed Nov 30, 2011 7:44 pm

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
[/code]
?

-----------------------------------
Llathe
Wed Nov 30, 2011 7:48 pm

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
Wed Nov 30, 2011 7:56 pm

RE:background and  text blending help
-----------------------------------
odd. I can't run Turing. Can someone else take a look to verify that this is broken?

-----------------------------------
Llathe
Wed Nov 30, 2011 8:00 pm

Re: background and  text blending help
-----------------------------------
Its not urgent.
A lot of things are placeholders right now.
Here is the source code.

-----------------------------------
Tony
Wed Nov 30, 2011 8:02 pm

RE:background and  text blending help
-----------------------------------
read carefully
[code]
offscreeonly
[/code]

-----------------------------------
Llathe
Wed Nov 30, 2011 8:11 pm

Re: background and  text blending help
-----------------------------------
Oh, I'm sorry for my carelessness. the flashing is gone.
There is another problem now. :oops: 
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.
