SFML community forums

Help => General => Topic started by: Skullek on June 08, 2016, 10:31:52 pm

Title: Problem with TMXloader
Post by: Skullek on June 08, 2016, 10:31:52 pm
Hi, How can i use https://github.com/fallahn/sfml-tmxloader if i got class header file.

For example in Level.H i can't use

tmx::MapLoader map;
cause it's got default constructor which is string/address... (Error   'tmx::MapLoader': no appropriate default constructor available)

if
        tmx::MapLoader map("../GraSFML/Maps");
I got( syntax error: 'string'   GraSFML   e:\dokumenty\visual studio 2015\projects\grasfml\grasfml\level.h   62)   

I only know how to use it in main function, but i don't want to.

How can i read map from .tmx file with this loader properly ?

Thanks :*
Title: Re: Problem with TMXloader
Post by: fallahn on June 08, 2016, 11:23:37 pm
Initialise it in your level constructor:
http://www.learncpp.com/cpp-tutorial/8-5a-constructor-member-initializer-lists/