![]() |
|
Tool tip display |
Fire Wolf
Member #7,640
August 2006
|
At the moment I have this Then the screen refreshes so I don't leave a trail, but its all flashy. The rest(100) is there to stop the soaking of CPU... and looks totaly err shit, anyone got a fix or a better way for doing tool tips? |
Derezo
Member #1,666
April 2001
![]() |
Rest(100) is wayyyy too long.. Try just 1. [edit] Oh wait, you're also drawing to the screen. Use a buffer (see examples). "He who controls the stuffing controls the Universe" |
Fire Wolf
Member #7,640
August 2006
|
ah buffers, ill try that brb |
DanielH
Member #934
January 2001
![]() |
If you are going to have more than one tool tip then I suggest having a structure of some sorts that will hold the coordinates to the tips. Just a suggestion. Here is something that I might do.
|
Fire Wolf
Member #7,640
August 2006
|
hmm, the program crashes when I added
Any ideas? |
DanielH
Member #934
January 2001
![]() |
DId you create a buffer? Also do all drawing to the buffer then draw the buffer to the screen.
What is CMenu Menu; Menu.Menu(); CMenu Menu_refresh; Menu_refresh.Menu_refresh(); Why not may Menu() a static function? class CMenu { ... ... void static Menu(); void static Menu_refresh(); ... ... }; // And call them like this CMenu::Menu_refresh(); CMenu::Menu();
|
Fire Wolf
Member #7,640
August 2006
|
Ooo good one DanielH thats just what I'm looking for! |
BAF
Member #2,981
December 2002
![]() |
You don't need to acquire/release the screen for one go like that, plus you should use blit, not draw_sprite. |
Fire Wolf
Member #7,640
August 2006
|
DanielH said: DId you create a buffer? Also do all drawing to the buffer then draw the buffer to the screen.
I did at the top, and the program still crashes with your refined code... DanielH said: What is CMenu Menu; CMenu Menu_refresh; Why not may Menu() a static function?
That calls other functions, but ill try your stuff |
DanielH
Member #934
January 2001
![]() |
What I'm saying is that you create a new variable to call one function when you could just call the function. // creates a new variable everytime the refresh function is called CMenu Menu; Menu.Menu(); // this only calls the function Menu CMenu::Menu(); About the buffer //And you said you did this BITMAP *buffer; //But did you do this after setting graphics and //before calling any drawing functions buffer = create_bitmap( SCREEN_W, SCREEN_H ) // and don't forget this when the program is finished destroy_bitmap( buffer );
|
Fire Wolf
Member #7,640
August 2006
|
DanielH said: If you are going to have more than one tool tip then I suggest having a structure of some sorts that will hold the coordinates to the tips. Just a suggestion. Here is something that I might do.
I tried that, when I hover the mouse over the area for the tool tip the program crashes... set_color_depth(16); Any ideas? |
|