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

Username:   Password: 
 RegisterRegister   
 background and text blending help
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Llathe




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


Turing:


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




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




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




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




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




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




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




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




PostPosted: Wed Nov 30, 2011 7:37 pm   Post subject: Re: background and text blending help

yes, i have
code:

View.Set ('offscreeonly, nobuttonbar,')
Tony




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

?
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Llathe




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




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




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



mathGame.t
 Description:

Download
 Filename:  mathGame.t
 Filesize:  4.44 KB
 Downloaded:  40 Time(s)

Tony




PostPosted: Wed Nov 30, 2011 8:02 pm   Post subject: RE:background and text blending help

read carefully
code:

offscreeonly
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Llathe




PostPosted: 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. Embarassed
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.
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 1  [ 15 Posts ]
Jump to:   


Style:  
Search: