I can't get variable to be displayed, but when I put int "Text" it works, heres the part of code. int scoreN = 1; SDL_Surface *Score = NULL; Score = TTF_RenderText_Solid( regfont, scoreN ,blackc); SDL_BlitSurface(Score,NULL,screen,&cords);
I want scoreN to increase when stick is picked, but I get error saying that invalid convertion from int to const char
You may want to pass that string as "const string& msg". This way is faster because the string won't be copied, just a reference will be passed (it's like a pointer). And const because you do not want to accidentally modify it in a drawing function.
am i the only one who noticed the intro and code at 0:16?
Deeharok 8 months ago in playlist Beginner's/Game Programming 1
I can't get the font to load.
font = TTF_OpenFont( "data/georgia.ttf", size );
doesn't work for me. How do I know the correct path to the font?
ScaredHelmet 1 year ago
LOL nevermind, I didn't realise you had to manually download fonts.
ScaredHelmet 1 year ago
Great
adkarb 1 year ago
I can't get variable to be displayed, but when I put int "Text" it works, heres the part of code. int scoreN = 1; SDL_Surface *Score = NULL; Score = TTF_RenderText_Solid( regfont, scoreN ,blackc); SDL_BlitSurface(Score,NULL,screen,&cords);
I want scoreN to increase when stick is picked, but I get error saying that invalid convertion from int to const char
anyone could help?
YouKondziu 1 year ago
@YouKondziu An int and a const char are different types of data you must first convert scoreN into a string probably using the _itoa_s () function.
Grenadiac111 1 year ago
@Grenadiac111
I already got it long time ago :P thanks for help though :)
YouKondziu 1 year ago
Lusikka, you have a nicer sounding voice.
atraub 2 years ago
You may want to pass that string as "const string& msg". This way is faster because the string won't be copied, just a reference will be passed (it's like a pointer). And const because you do not want to accidentally modify it in a drawing function.
TomCatFort 2 years ago
Nice tut o/
thnx
GuiltyGeek 2 years ago
yay it's finally out
TheShadowsedge 2 years ago 2
Yooop! Thank ye thank ye Alex. Sorry I didn't get this done before I went on vacation. P:
LusikkaMage 2 years ago
Thanks!
ADeadRock 2 years ago 3
Thanks ^0^
TheReasonWhyGuy 2 years ago 3