![]() |
|
This thread is locked; no one can reply to it.
![]() ![]() |
1
2
|
Ha haha..... I'm having trouble with alfont. |
Taiko Keiji
Member #8,307
February 2007
![]() |
I've been using alfont for a while and it worked just fine. but for some strange reason when i use it in conjunction with my GameEngine it doesn't want to load the fonts. What am I going to do!!!! Life could be better, machines could program themselves. Taiko Keiji- |
CGamesPlay
Member #2,559
July 2002
![]() |
Certainly not get help, that's for sure. You forgot to post what you were doing, your code, your error, or your versions. I'm going to bet that it's a CWD problem. -- Ryan Patterson - <http://cgamesplay.com/> |
Taiko Keiji
Member #8,307
February 2007
![]() |
sorry, just give me a moment to get the files.
this is my main file. It should work fine right. Life could be better, machines could program themselves. Taiko Keiji- |
CGamesPlay
Member #2,559
July 2002
![]() |
Now you forgot to tell us the error. -- Ryan Patterson - <http://cgamesplay.com/> |
Taiko Keiji
Member #8,307
February 2007
![]() |
I did tell you that it wont load the font didn't I? indirectly, I guess I should have been more clear. It says NO Font just like it's supposed to when it fails to load the font. Life could be better, machines could program themselves. Taiko Keiji- |
CGamesPlay
Member #2,559
July 2002
![]() |
Okay, so does the file Fonts\abaddon.ttf exist? Where is it in relation to your EXE? How do you run the EXE? -- Ryan Patterson - <http://cgamesplay.com/> |
Taiko Keiji
Member #8,307
February 2007
![]() |
The file does exist. It's in a Fonts folder along with the exe, well the exe is outside the fonts folder obviously. you understand. but like I said i've used this before and it worked just fine. Life could be better, machines could program themselves. Taiko Keiji- |
CGamesPlay
Member #2,559
July 2002
![]() |
How do you run the EXE? What if you add this code before you load the font: if(!file_exists("Fonts/abaddon.ttf")) { set_gfx_mode(GFX_TEXT, 0, 0, 0, 0); allegro_message("%s/Fonts/abaddon.ttf does not exist", getcwd(NULL, 1024)); } font1=alfont_load_font("Fonts/abaddon.ttf");
-- Ryan Patterson - <http://cgamesplay.com/> |
Onewing
Member #6,152
August 2005
![]() |
Ha haha..... I forgot to read the rest of this thread. ------------ |
Taiko Keiji
Member #8,307
February 2007
![]() |
Ok. Your right. It says that the file doesn't exist. I know it does and the folder is there, why wont it recognise the file??? Life could be better, machines could program themselves. Taiko Keiji- |
CGamesPlay
Member #2,559
July 2002
![]() |
I need you to write down the way all of the folders in your project are laid out including the location of Fonts/abaddon.ttf and your exe. Then I need you to tell me how you run the exe. Oh, and is the file accidentally named Fonts/abandon.ttf? -- Ryan Patterson - <http://cgamesplay.com/> |
BAF
Member #2,981
December 2002
![]() |
Quote:
}//end the inner if statement }//end the second to last if statement }//end third to last if statement }//end the fifth if statement }//end the fourth if statement }//end the third if statement }//end the second if statement }//ends the first statement
Those are about the most worthless comments ever. |
Taiko Keiji
Member #8,307
February 2007
![]() |
Ok everything os in a folder called GameEngine right. ok. from there we have all the header files(GameEngine.h)and the C++ files(GameEngine.cpp and Main.Cpp) the exe is in there aswell along with the makefile and the .o files(for GameEngine and main). Then theres another folder labeled Fonts, in there I have the font named abaddon.ttf. That's everything I have. I tried it with another font that I know works because it's the one I was using before but that wont work either. BTW: BAF, shut up. I know their worthless, I copied it from a tutorial I made and didn't feel like deleting them. Life could be better, machines could program themselves. Taiko Keiji- |
CGamesPlay
Member #2,559
July 2002
![]() |
And, like I've asked in my past 3 posts, how do you run the EXE? -- Ryan Patterson - <http://cgamesplay.com/> |
Taiko Keiji
Member #8,307
February 2007
![]() |
Sorry, Uhhh. double click?! It's just an allegro win program. I don't know how to do anything special with it. Life could be better, machines could program themselves. Taiko Keiji- |
Ceagon Xylas
Member #5,495
February 2005
![]() |
Dont need quite so many brackets if (set_gfx_mode(GFX_AUTODETECT,1280,1024,0,0)!=0) if (set_gfx_mode(GFX_AUTODETECT,1280,960,0,0)!=0) if (set_gfx_mode(GFX_AUTODETECT,1280,768,0,0)!=0) if (set_gfx_mode(GFX_AUTODETECT,1280,720,0,0)!=0) if (set_gfx_mode(GFX_AUTODETECT,1152,864,0,0)!=0) if (set_gfx_mode(GFX_AUTODETECT,1024,768,0,0)!=0) if (set_gfx_mode(GFX_AUTODETECT,800,600,0,0)!=0) if (set_gfx_mode(GFX_AUTODETECT,640,480,0,0)!=0) { set_gfx_mode(GFX_TEXT,0,0,0,0); allegro_message("Cannot initialize graphics mode! %s", allegro_error); } Will do |
CGamesPlay
Member #2,559
July 2002
![]() |
Okay, so when I gave you that code that told you the file didn't exist, was it looking at the right folder? I mean, when the message box comes up, press Ctrl+C to copy the text in it, then paste it here. Go to the folder that is in the path and tell me that abaddon.ttf is listed there. -- Ryan Patterson - <http://cgamesplay.com/> |
Taiko Keiji
Member #8,307
February 2007
![]() |
--------------------------- That's where it is. I don't understand why it desnt work when I have another file E:\game stuff\Dev-Cpp\YCPE/Fonts/abaddon.ttf and that works just fine. this is the file that abaddon.ttf is in E:\game stuff\Dev-Cpp\Game Engine\Fonts Life could be better, machines could program themselves. Taiko Keiji- |
CGamesPlay
Member #2,559
July 2002
![]() |
Quote: That's where it is. According to your computer, you're wrong. It could be a permissions problem, but I'm almost certain that it isn't. If you go to the font file's properties and have a "security" tab, make sure that "Everyone" has "Read" access. If that doesn't solve your problem, one of the following is true: - The file abaddon.ttf really doesn't exist in E:\game stuff\Dev-Cpp\Game Engine\Fonts. You have to put it there. [append] -- Ryan Patterson - <http://cgamesplay.com/> |
BAF
Member #2,981
December 2002
![]() |
if (set_gfx_mode(GFX_AUTODETECT,1280,1024,0,0) || set_gfx_mode(GFX_AUTODETECT,1280,960,0,0) || set_gfx_mode(GFX_AUTODETECT,1280,768,0,0) || set_gfx_mode(GFX_AUTODETECT,1280,720,0,0) || set_gfx_mode(GFX_AUTODETECT,1152,864,0,0) || set_gfx_mode(GFX_AUTODETECT,1024,768,0,0) || set_gfx_mode(GFX_AUTODETECT,800,600,0,0) || set_gfx_mode(GFX_AUTODETECT,640,480,0,0)) { set_gfx_mode(GFX_TEXT,0,0,0,0); allegro_message("Cannot initialize graphics mode! %s", allegro_error); }
That should work fine too, and it doesn't look as ugly. |
Onewing
Member #6,152
August 2005
![]() |
if (set_gfx_mode(GFX_AUTODETECT,1280,1024,0,0) || set_gfx_mode(GFX_AUTODETECT,1280,960,0,0) || set_gfx_mode(GFX_AUTODETECT,1280,768,0,0) || set_gfx_mode(GFX_AUTODETECT,1280,720,0,0) || set_gfx_mode(GFX_AUTODETECT,1152,864,0,0) || set_gfx_mode(GFX_AUTODETECT,1024,768,0,0) || set_gfx_mode(GFX_AUTODETECT,800,600,0,0) || set_gfx_mode(GFX_AUTODETECT,640,480,0,0)) { set_gfx_mode(GFX_TEXT,0,0,0,0); allegro_message("Cannot initialize graphics mode! %s", allegro_error); } The question is, can you really depend on it short circuiting? ------------ |
Ceagon Xylas
Member #5,495
February 2005
![]() |
const int res[]={ 1280,1024, 1280,960, 1280,768, 1280,720, 1152,864, 1024,768, 800,600, 640,480 }; for(int i=0; i<18; i+=2) { if(i>16) { set_gfx_mode(GFX_TEXT,0,0,0,0); allegro_message("Cannot initialize graphics mode! %s", allegro_error); } else if(set_gfx_mode(GFX_AUTODETECT,res<i>,res[i+1],0,0)==0) break; }
|
Onewing
Member #6,152
August 2005
![]() |
Quote: Okay, I won't get this any further off topic. But I will! It'd be better to get_gfx_mode_list. ------------ |
Kibiz0r
Member #6,203
September 2005
![]() |
Shouldn't this be under programming questions, since it's low-level rather than high-level? --- |
Taiko Keiji
Member #8,307
February 2007
![]() |
OK. I figured it out and it's a real shame that we all missed it. alfont_init(); that's it. That is all that was missing. Life could be better, machines could program themselves. Taiko Keiji- |
|
1
2
|