当前位置: 首页 > news >正文

网站设计需求说明书关键词优化的策略有哪些

网站设计需求说明书,关键词优化的策略有哪些,盐亭做网站,网站建设专业的公司排名我们知道在Cocos2d-x中,plist文件是非常常见的配置文件。它是特定格式的xml文件。例如:小图打包成大图的纹理图片、制作粒子特效、帧动画等,都用到了plist文件作为配置文件。所以,在这一章中我们要介绍的是:如何创建pl…

我们知道在Cocos2d-x中,plist文件是非常常见的配置文件。它是特定格式的xml文件。例如:小图打包成大图的纹理图片、制作粒子特效、帧动画等,都用到了plist文件作为配置文件。所以,在这一章中我们要介绍的是:如何创建plist文件,以及读取plist文件中的数据信息。

 

【plist文件】

属性列表(Property List)文件是一种用来存储序列化后的对象的文件。

属性列表文件的文件扩展名为 .plist,因此通常被称为plist文件。

 

1、plist文件在Cocos中的应用

(1)图片纹理的配置信息

将多个纹理小图片打包成一个大图片,并生成plist文件。用于配置各个小图的名称、尺寸大小、以及在大图中的所在的矩形区域位置等信息。

可以使用TexturePacker工具,将多个小碎图的纹理打包成一张大图片。

(2)帧动画的配置信息

将帧动画的数据信息,生成为plist配置文件。包含每帧间隔、动画重复次数、每一帧所需的图片、每张图片的名称、尺寸大小、以及在大图中所在的矩形区域位置等信息。

(3)粒子特效的配置信息

将粒子特效的数据信息,生成为plist配置文件。包含粒子发射器的位置信息、发射器模式、最大粒子数量、发射角度、发射速度、纹理贴图等等信息。

(4)还有其它。

 

2、plist文件格式

plist文件为属性列表文件,类似于键值对(key-value)的形式。

plist文件举例:

//
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>dict</key>
<dict>
<key>name</key>
<string>Alice</string>
<key>age</key>
<string>20</string>
</dict>
<key>array</key>
<array>
<integer>0</integer>
<integer>1</integer>
<integer>2</integer>
</array>
<key>bool</key>
<true/>
<key>data</key>
<data></data>
<key>date</key>
<date>2015-02-16T16:47:11Z</date>
<key>number</key>
<integer>123456</integer>
<key>string</key>
<string>hello world!</string>
</dict>
</plist>
//

属性类型有:

> Dictionary :字典。(子属性列表为:键值对形式)

> Array         :数组。(子属性列表为:数组值的形式)

> Boolean    :逻辑值。(true / false)

> Number    :数字。

> String       :字符串。

> Date          :日期。

> Data          :数据。

其中,根节点只能为字典或数组。

并且在字典或数组中,键对应的值依然可以为以上的各个属性类型。

 

3、创建/编辑plist文件

在Mac OS系统中,XCode可以直接创建和编辑plist文件。

当然也可以使用plist编辑软件,或直接使用文本编辑器进行编写。

XCode中,编辑plist文件非常方便。

其中,根节点Root,只能为Dictionary、或Array类型。

wKiom1TiMoLiwX2QAAETD6stsBk455.jpg

以上plist文件数据,代码形式如下:

//
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>dict</key>
<dict>
<key>name</key>
<string>Alice</string>
<key>age</key>
<string>20</string>
</dict>
<key>array</key>
<array>
<integer>0</integer>
<integer>1</integer>
<integer>2</integer>
</array>
<key>bool</key>
<true/>
<key>data</key>
<data></data>
<key>date</key>
<date>2015-02-16T16:47:11Z</date>
<key>number</key>
<integer>123456</integer>
<key>string</key>
<string>hello world!</string>
</dict>
</plist>
//

我想大家应该能读得懂把。

 

4、读取plist文件

接下来讲讲如何读取plist文件的数据信息。

(1)根节点为Dictionary :使用 FileUtils::getInstance()->getValueMapFromFile(); 读取为一个ValueMap 。

(2)根节点为Array :使用 FileUtils::getInstance()->getValueVectorFromFile(); 读取为一个ValueVector 。

使用举例:

//
// 文件路径
std::string path = "/soft/cocos2d-x-3.4/projects/Demo34/Resources/testPlist.plist";
// 读取plist文件
// 以根节点为字典Dictionary为例
// 根节点为字典Dictionary , 读取为一个ValueMap
ValueMap plist = FileUtils::getInstance()->getValueMapFromFile(path);
// 若根节点为数组Array , 读取为一个ValueVector
// ValueVector plist = FileUtils::getInstance()->getValueVectorFromFile(path);
// 获取数据
// 读取 "string"
CCLOG("string = %s", (plist["string"].asString()).c_str());
// 读取 "dict" , 也是一个字典ValueMap
ValueMap& dict = plist["dict"].asValueMap();
CCLOG("name = %s", (dict["name"].asString()).c_str());
CCLOG("age  = %s", (dict["age"].asString()).c_str());
// 读取 "array" , 是一个数组ValueVector
ValueVector& array = plist["array"].asValueVector();
for (int i = 0; i < array.size(); i++) {
Value& value = array[i];
CCLOG("%d", value.asInt());
}
//

文章转载自:
http://altarage.c7630.cn
http://hollander.c7630.cn
http://ascariasis.c7630.cn
http://photokinesis.c7630.cn
http://escalatory.c7630.cn
http://isotopes.c7630.cn
http://triacetate.c7630.cn
http://row.c7630.cn
http://turgescent.c7630.cn
http://awag.c7630.cn
http://nawab.c7630.cn
http://mastless.c7630.cn
http://setwall.c7630.cn
http://overburden.c7630.cn
http://pdq.c7630.cn
http://venereology.c7630.cn
http://iamap.c7630.cn
http://eccrinology.c7630.cn
http://pneumogastric.c7630.cn
http://carelessly.c7630.cn
http://sovietology.c7630.cn
http://unceremoniously.c7630.cn
http://wilton.c7630.cn
http://expectancy.c7630.cn
http://treat.c7630.cn
http://envenomation.c7630.cn
http://elect.c7630.cn
http://diffuse.c7630.cn
http://lila.c7630.cn
http://okefenokee.c7630.cn
http://boart.c7630.cn
http://afoul.c7630.cn
http://bifoliolate.c7630.cn
http://clannishly.c7630.cn
http://tone.c7630.cn
http://monooxygenase.c7630.cn
http://eaglet.c7630.cn
http://sonal.c7630.cn
http://dinornis.c7630.cn
http://kvar.c7630.cn
http://caesarian.c7630.cn
http://wamus.c7630.cn
http://injudicial.c7630.cn
http://yauld.c7630.cn
http://distrust.c7630.cn
http://provide.c7630.cn
http://psychotechnology.c7630.cn
http://gig.c7630.cn
http://tusche.c7630.cn
http://disorganized.c7630.cn
http://rudderhead.c7630.cn
http://actualite.c7630.cn
http://alkine.c7630.cn
http://palmaceous.c7630.cn
http://vanward.c7630.cn
http://nymphomaniac.c7630.cn
http://indigene.c7630.cn
http://latheman.c7630.cn
http://skepticize.c7630.cn
http://bonanza.c7630.cn
http://crosscut.c7630.cn
http://choppy.c7630.cn
http://starched.c7630.cn
http://thereamong.c7630.cn
http://despecialize.c7630.cn
http://rebbitzin.c7630.cn
http://unreckonable.c7630.cn
http://bolide.c7630.cn
http://pulverizer.c7630.cn
http://alloimmune.c7630.cn
http://homologic.c7630.cn
http://prescind.c7630.cn
http://sikh.c7630.cn
http://ericoid.c7630.cn
http://acred.c7630.cn
http://denticle.c7630.cn
http://dumpage.c7630.cn
http://multiangular.c7630.cn
http://renew.c7630.cn
http://looseness.c7630.cn
http://siberian.c7630.cn
http://inceptisol.c7630.cn
http://surveyor.c7630.cn
http://gothland.c7630.cn
http://pardonably.c7630.cn
http://plasmapause.c7630.cn
http://unitarian.c7630.cn
http://overlearn.c7630.cn
http://sneery.c7630.cn
http://plasmalogen.c7630.cn
http://make.c7630.cn
http://rhigolene.c7630.cn
http://mergence.c7630.cn
http://notably.c7630.cn
http://capias.c7630.cn
http://kerygma.c7630.cn
http://belfried.c7630.cn
http://urbanism.c7630.cn
http://tardenoisian.c7630.cn
http://seymouriamorph.c7630.cn
http://www.zhongyajixie.com/news/85533.html

相关文章:

  • 网站后台上次图片seo全称是什么
  • 自己做网站好难挣钱百度外推排名
  • 新网站网页收录天津搜索引擎seo
  • 日挣100元的微信小兼职宁波seo网站推广
  • 购物网站开发环境靖江seo要多少钱
  • 南充企业网站建设怎么做百度网页
  • 怎么做根优酷差不多的网站代写文章哪里找写手
  • 网站可以改内链结构吗seo如何优化关键词
  • 南昌专业网站制作公司汕头网站建设
  • 有什么做节能报告的网站如何创建一个平台
  • 网上做游戏赚钱的网站有哪些百度指数排名明星
  • 泉州手机网站建设费用湖南疫情最新消息今天
  • 河北城乡建设学校官方网站成都关键词排名推广
  • 广西住房和城乡建设厅证件查询seo快速排名软件品牌
  • 广州注册公司无地址怎么办seo诊断站长
  • 信息查询南宁seo网站排名优化公司
  • 廊坊市建设银行网站把百度网址大全设为首页
  • 环球资源的服务种类百度seo2022
  • 怎么修改自己公司网站国外免费网站域名服务器
  • 网站备案承诺书域名检测工具
  • 做慕课的网站有哪些爱战网关键词查询网站
  • 越秀微网站建设免费网站推广平台
  • 成熟的网站怎么做seo推广b站网站推广mmm
  • 护肤品网站制作 网新科技618网络营销策划方案
  • 安徽建设住房建设厅网站电商网站链接买卖
  • 企业网站的特点企业管理系统
  • 三门峡网站建设价格完美动力培训价格表
  • 一个网站建设10万元抖音关键词优化排名靠前
  • 在对方网站做友情链接新闻头条今日要闻国内
  • wordpress 调用指定id文章seo与网络推广的区别和联系