• Create Account

#Actualfastcall22

Posted 01 November 2012 - 05:51 PM

What I want to do is that after the text is sent to the screen that the text would be cleared from the screen

I have tried printing text to the screen in red color and then printing the same text to the screen in black but it does not erase the text that is already printed there.

You cannot erase what is already drawn to the screen. If you had an integer x, would you be able to see what values it previously held? No, keeping track of such data for every variable and every pixel is infeasible. It is faster and easier to redraw everything, excluding the stuff you don't want visible.

Phil, I strongly recommend researching game loops and structuring your game accordingly. In your case, it probably look something like this:

load_fonts

while ( not user_quit ) {
while ( events_to_be_processed )
process_window_event()

clear_screen()
draw_game()
if ( should_draw_instructions )
draw_instructions()
}

release_resources
release_fonts


#1fastcall22

Posted 01 November 2012 - 05:39 PM

What I want to do is that after the text is sent to the screen that the text would be cleared from the screen

I have tried printing text to the screen in red color and then printing the same text to the screen in black but it does not erase the text that is already printed there.

You cannot erase what is already drawn to the screen. If you had an integer x, would you be able to see what values it previously held? No, keeping track of such data for every variable and every pixel is infeasible. It is faster and easier to redraw everything, excluding the stuff you don't want visible.

Phil, I strongly recommend researching game loops and structuring your game accordingly. In your case, it probably look something like this:

load_fonts

while ( not user_quit ) {
while ( events_to_be_processed )
process_window_event()

if ( should_draw_instructions )
draw_instructions()

draw_game()
}

release_resources
release_fonts


PARTNERS