I found myself needing to find .txt (And eventually, .json) files from my media folder in my games. This works perfect for Windows, but it fails to load in Android. What is the solution to this? Here is my code I am using:
#include <fstream>
std::ifstream stream("media\\animationnames.txt");
std::string bufferString;
//Cycle through the images to load them.
for (int i = 0; i < 128; i++)
{
//Only load the image if it exists.
if (std::getline(stream, bufferString))
{
spriteImg[i] = agk::LoadSubImage(image, bufferString.c_str());
}
}
stream.close();
I tried using AppGameKit provided commands to load these files, but I could never get them to work properly. Anyone have any ideas?
Also note, the "SetFolder" command documentation states that the default folder on windows is "C:\Users\username\AppData\AGKApps\appName" which is incorrect. It is actually "C:\Users\username\Documents"