| programmeraie125 (86) | |||
I am trying to get my font to flash and Change colour on my splash screen I tried getting it to change by using delta time at 2 second increment but it Only updates once then switches into My main menu and font never seems to change colour I gone break point crazy on this but I cant seem to identify were the problem lies Also I can post up font class and Delta time class's if needed Thanks for your time
| |||
|
|
|||
| andywestken (1950) | |||
|
What GUI library are you working with? I think the problem is elsewhere in you code. If I understand you correctly, the code fragment you posted above is called just once. So it's the code which is calling this code which is of more interest. But I note you are incrementing the time on every comparison. Did you mean to do that, or did you just want to increment it once and then work out which color was needed? (And the time slot 2-4 doesn't appear to be covered? Andy PS Your code looks like it could be factored so that only the color is set conditionally. (I'm assuming you wanted the member variable stepped on each call?)
| |||
|
Last edited on
|
|||
| programmeraie125 (86) | |||
|
The gui I using is "sdl_opengl.h" Its meant to flash on every 2 seconds with a different colour and every other second not be visible Umm the entire .cpp file for that is below
it only gets called in from draw while the splash screen is going, splash screen only lasts 10 seconds then switches by default to main menu if there is anything you would like me to link in perticular just tell me | |||
|
Last edited on
|
|||
| andywestken (1950) | ||
If Scene_SplashScreen::Draw() is only ever being called once, it seems you need something to trigger the redraw. Unfortunately I don't know SDL, so I don't know what to suggest next. Any SDL types about??? Andy | ||
|
|
||
| EssGeEich (685) | |
|
Try adding a message box or some breakpoint in your Scene:SplashScreen::Draw function's beginning. I'd create a FlashingText Class. Then you should hold a variable that holds the color you want and the time that the flashing action should be triggered. Each frame you change this color from the class interface, using linear interpolation if you prefer, remember to use the delta time for better linear calculations that don't change from pc to pc. Whithin the class's Draw function (you will have to make one i guess?) you do the flashing computations and eventually draw the text. | |
|
|
|