Printing out self.scrollSpeed.getValue() shows the correct value, however that value is not written back to the PRC file. Is there a way in Panda to write the value back to the prc file (or do I need code something to do it).
I had originally written a registry class to write all values to the registry in windows. This class works great, however I didn’t want to handle multiple ways of retrieving/saving config data (for multiple os’) and so I am going back and redoing that portion of my code to use a prc file for storing game data.
sunday_coder, you said,
“remember u have to save/write ALL stuff that should be in ur file, because ur not adding content into the config, but overwriting it!”
is it possible to just append to it.
I ask mainly because this file is a mystery to me. I am very new to Panda and just now getting into antialiasing on my screen. Its not working, I think because I have yet to add “framebuffer-multisample 1”
“multisamples 2” to the Config.prc file as per the manual. If this is the case how do I add it without srewing up the whole file by overwriting everything (which I haven’t a clue what it is).
Yes. The return value of loadConfigPage() or loadConfigData() is a ConfigPage object (or you can pull an existing ConfigPage object from the cpMgr). This object has a write() method that dumps its output to a stream; from Python, you can give it a StringStream to write to a string, or an OFileStream to write the data to disk.
But, writing out a formatted list of lines using Python’s standard write() method works perfectly well, too.