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

Author Topic: Custom Properties  (Read 1448 times)

0 Members and 1 Guest are viewing this topic.

vovik_0_1

  • Newbie
  • *
  • Posts: 11
    • View Profile
    • Email
Custom Properties
« on: April 29, 2014, 10:00:24 pm »
Hey. I'm creating a game for SFML in VS 11 and connect Box2d.
Loading map using https://github.com/fallahn/sfml-tmxloader
Map created in the program Tiled Map Editor.
Tell me how you can consider the option "Custom Properties" object, for example variable "Te".


vovik_0_1

  • Newbie
  • *
  • Posts: 11
    • View Profile
    • Email
Re: Custom Properties
« Reply #1 on: June 06, 2014, 08:10:56 pm »
Help please!

zsbzsb

  • Hero Member
  • *****
  • Posts: 1409
  • Active Maintainer of CSFML/SFML.NET
    • View Profile
    • My little corner...
    • Email
Re: Custom Properties
« Reply #2 on: June 06, 2014, 08:41:34 pm »
I am not sure anyone (myself included) understands what you are asking. You should probably clarify what you want and then maybe we would be able to help you.  ;)
Motion / MotionNET - Complete video / audio playback for SFML / SFML.NET

NetEXT - An SFML.NET Extension Library based on Thor

vovik_0_1

  • Newbie
  • *
  • Posts: 11
    • View Profile
    • Email
Re: Custom Properties
« Reply #3 on: June 06, 2014, 08:55:47 pm »
I need to get the parameter "Texture". For example:
const std::vector<tmx::MapLayer>& layers = ml.GetLayers();
        for (const auto& l : layers)
        {
                 if (l.name == "Din")
                {      
                        for (const auto& o : l.objects)
                        {                      
                            if(o.GetName() == "Block") //  
                                {
                                        std::string tex  = o.GetNameTexture();    Get parameter "Texture"
                                       dimen = tmx::BodyCreator::Add(o, world, false , b2BodyType::b2_dynamicBody);
                                        Block.Create(dimen);

                                    Blocks.push_back(Block);
                                }                      
                       
                        }
                }
        }
In the variable "tex" should be "Block.png"

« Last Edit: June 06, 2014, 09:08:30 pm by vovik_0_1 »

 

anything