User Tools

Site Tools


cn:orx:config:main

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
cn:orx:config:main [2010/08/05 05:27 (15 years ago)] yatusitercn:orx:config:main [2020/08/19 20:03 (5 years ago)] (current) – Old content sausage
Line 1: Line 1:
-====== 配置 ====== 
  
-本部分专注于[[http://orx-project.org|orx]]的配置系统,Orx是一个开源、跨平台、轻量、数据驱动及2D游戏引擎。 
-===== 简介 ===== 
- 
-配置系统是Orx的核心模块之一。它是使得Orx成为一个数据驱动游戏引擎的主要模块。\\ 
-它是需要学习的最重要的模块之一,因为它可以在运行中调整和修改。\\ 
-当你习惯它以后,你的开发时间将会大大地缩短。 
- 
- 
-它的格式和[[wp>INI_file|INI 文件]]中的基本一致。但是添加了一些如同继承和重载的概念。 
-同时也添加了一些特别的操作符((例如,为了处理list,random或者包含文件))将会在 [[syntax|语法部分]]中介绍。 
- 
- 
- 
-===== General information ===== 
- 
-When orx is initialized, it will use the executable name to deduce the main config file name.\\ 
-Basically it will remove the extension from your executable name, if any, and add the ''.ini'' extension. If you're using orx launcher (''orx.exe/orx''), the main config file will be orx.ini.\\ 
-In the same way, if your program is called ''MyNewGame.exe'', the main config file that will be loaded when orx is initialized will the ''MyNewGame.ini''. 
- 
-In that file you can include as many other config files ((with any kind of extension, ''.ini'' isn't mandatory)) you want.\\ 
-You can also load config files directly in code. 
- 
-<code c>orxConfig_Load("MyConfigFile.cfg");</code> 
- 
-Once a config file is loaded, accessing its information will be done in memory, the file won't be read from disk again unless specifically asked with calls to ''orxConfig_Load()'' or ''orxConfig_ReloadHistory()''. 
- 
-You can even save the content of the config to a file, either completely or partially. Here's the function you need to call in order to do so: 
- 
-<code c>orxConfig_Save("MyConfigFile.cfg", bEncrypt, MySaveFilter);</code> 
- 
-''MySaveFilter'' is a callback that will be called for every section and every key to let you decide if you want to save this info to the file or not.\\ 
-If you pass ''orxNULL'' instead of a valid callback, every single key/value pair will be saved.\\ 
-Please note that the original comments of originally loaded files won't be saved as they're ignored during the loading and never stored in memory. 
- 
-In your ''MySaveFilter'' callback, when provided with a name for a section and ''orxNULL'' as a key, it is for you to decide if you want to save some parts of this section (by returning ''orxTRUE'') or if you'd rather skip the whole section completely (by returning ''orxFALSE'').\\ 
-In the first case, you will then be asked for each key/value pair of this section if you want to save it or not. 
- 
-This filter system is very handy when you want to save partial data, like for handling save games as you'll see in [[savegame|the savegame section]]. 
- 
-You can find the config module API in doxygen format via [[http://doc.orx-project.org|orx's doxygen doc page]] or directly [[http://doc.orx-project.org/group__orx_config.html|here]].\\ 
-We believe the API is self explanatory and shouldn't be much troublesome to learn. 
- 
-Config's module use, data-wise, is thoroughly described in below sections.\\ 
-The last section shows how to adapt it for handling save games. 
- 
-There are many ways in which the config module can be helpful: for example, it already is the base for the localization module.\\ 
-It's now up to you to find other clever ways of using it depending on your needs. =) 
- 
- 
-===== Sections ===== 
- 
-  * [[Syntax]] 
-  * [[cn:orx:config:settings_main:main|Orx's main settings]] 
-  * [[cn:orx:config:settings_structure:main|Orx's structures settings]] 
-  * [[encryption|Encryption & orxCrypt program]] 
-  * [[savegame|Using config module for savegames]] 
cn/orx/config/main.1281011271.txt.gz · Last modified: 2017/05/30 00:50 (8 years ago) (external edit)