Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Paths [Solved]  (Read 1190 times)

0 Members and 2 Guests are viewing this topic.

nicedude80

  • Newbie
  • *
  • Posts: 22
    • View Profile
Paths [Solved]
« on: October 31, 2013, 11:53:22 pm »
I was wondering how to write paths?

Like to load a font I have a folder that has my exe in it, then i have a folder (fonts) inside that, and in the fonts folder I have a file called arial.ttf.

How do I use the path (fonts\arial.ttf) in the if(!font.loadFromFile(insert path here)) statement? I dont know the proper format for paths.

Thanks!

I solved it. All I had to do was use // instead of \ or \\ like if(!font.loadFromFile(fonts//arial.ttf))
« Last Edit: November 01, 2013, 12:44:20 am by nicedude80 »

Stauricus

  • Sr. Member
  • ****
  • Posts: 369
    • View Profile
    • A Mafia Graphic Novel
    • Email
Re: Paths [Solved]
« Reply #1 on: November 01, 2013, 11:40:24 am »
what? i don't understand why that worked, but you need to put quotes around the path name:
 if(!font.loadFromFile("fonts/arial.ttf"))
Visit my game site (and hopefully help funding it? )
Website | IndieDB