Frogger Dev. Post 13
|
Not too much progress today on my part. It is a little bit funny that displaying a simple text is more complicated than displaying and maintaining several images. In my quest to make the HUD for the game I realized that I had to learn how a new library work. As far as I was able to gather I have to change the sprite every time I want to make the number change. To do this I made a function in my Sprite that basically allows me to change the renderer, however, it seems as if whenever I use it, it fails for some reason. The code looks something like this: TTF_Font *l_pFont = TTF_OpenFont(“FreeSerifBold.ttf”, 12); SDL_Color l_ColFore = { 255, 255, 255 }; //std::string *l_sText = l_iText; SDL_Surface *l_pText = TTF_RenderText_Solid(l_pFont, “Hello_World”, l_ColFore); m_cpaSprite[0]->SetSur(l_pText); And the function in Sprite looks like this: void Sprite::SetSur(SDL_Surface *p_SurpAlpha){ For some reason I can’t use this method. Maybe there is a very simple solution, I’m still unfamiliar with the library so I might have to put otghether a few training programs. I think I’ll try making a Text class thich might help out using the score and time writing. While I was working on the HUD Herman worked on the animations, appearently they didn’t get done but I hope that it’s going well. Tomorrow’s the day that I leave for Visby once again, I am not going to be able to work as much during that time, but I trust Herman can do well without me, I will arrive in town at 23:20. Oh, and I also found out that the date for sending in your work is the 19th, I previously thought it was the 7th. Oh well, maybe trying to get done by the 7th isn’t such a bad idea, never hurts to be done early. (Of course, all of my attempts at following some kind of scedule have been mildly successful at best, I’m still not confident in my planning skills) Still, it’s nice to know that we have more time than previously expected. |