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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Prummi

Pages: [1]
1
Graphics / Re: xcode image loading error
« on: February 04, 2018, 11:11:28 pm »
Ohh wow that's a pretty silly mistake, but thanks a lot! It finally works now. Is there any reason why I need to use the whole path? As the book I'm reading doesn't say or notice this. And is there a way around this?

2
Graphics / Re: xcode image loading error
« on: February 04, 2018, 02:48:35 pm »
the code:

if (!mTexture.loadFromFile("Media/Textures/Eagle.png"))
mFont.loadFromFile("Media/Sansation.ttf");

folder structure:
*project name* contains [ExternalLibraries], [Media], [*project name], [.xcodeproj file]
media contains Sansation.ttf and [Textures]
Textures folder contains Eagle.png

I tried the whole path, which is:
if (!mTexture.loadFromFile("/Users/Prummi/Desktop/dev/C++/SFML/SFML Game Development Book/Media/Textures"))
but this didn't work. It gave me the same error (unable to open file)

3
Graphics / xcode image loading error
« on: February 04, 2018, 11:46:06 am »
Hello,

I bought a book (SFML game development) and I can't get trough the first chapter. I need to load an image and a font but both of them won't load. The errors;

Failed to load image "Media/Textures/Eagle.png". Reason: Unable to open file
Failed to load font "Media/Sansation.ttf" (failed to create the font face)

I work in xCode. I don't know if this could be the problem but this is how I worked;
- I made a folder in finder called Media, in which I put the Textures map and put it all in (without involving xcode).

I made sure that hide file extension is checked off. I tried to put the Media folder in the folder in which the *projectName*.xcodeproj is, and in the folder where the files are but both ways didn't work.

Could anyone help me out please?

Pages: [1]