首页 > REDM设计器教程 > REDM设计器教程12-增加主题包
2016十二月27

REDM设计器教程12-增加主题包

[隐藏]

  修改前的MyTest下载–>  

  

MyTest.zip

   修改后的MyTest+图片下载–>  

tempimg.zip

MyTest.zip

  

1.主题包简介

  

主题包保存了皮肤对应的图片资源,DM库的皮肤内置查找图片资源方式如下:

优先从默认主题包中查找图片资源,如果未找到,则遍历所有的主题包查找图片资源(可以禁止遍历)

  

 例如Skin名为QQ的皮肤,它的查找顺序是:(以修改后的MyRes包为例)

1.MyRes\layout\xml\global.xml中记录了皮肤,src="png:QQ"

<imglist id="QQ" src="png:QQ" states="1" bvert="0" btitle="0" />

  

2.MyRes\themes\dmindex.xml中记录了所有的主题包,name指定了默认主题包名(如果没有默认的name,取第一个为默认主题包),这里取了theme1

<resource>
	<themes name="theme1">// name指定了默认主题包名theme1
		<file name="theme0" path="themes\theme0\dmindex.xml" />
		<file name="theme1" path="themes\theme1\dmindex.xml" />
	</themes>
</resource>

 

3.从\MyRes\themes\theme1\dmindex.xml中查找src="png:QQ"

	<png>
	        .......
		<file name="QQ" path="themes\theme1\QQ.png" />
	</png>

OK,找到图片资源路径为\MyRes\ + themes\theme1\QQ.png(如果未找到,则顺序从其他主题包查找)

 

4.如果2中name为theme0,则从从\MyRes\themes\theme0\dmindex.xml中查找src="png:QQ"

<png>	
		<file name="QQ" path="themes\theme0\image\QQ.png" />
	</png>

OK,找到图片路径为\MyRes\ + themes\theme0\image\QQ.png(如果未找到,则顺序从其他主题包查找)

  

 我们可以看出,通过改过默认主题包,实现skin图片资源的变化,从而大面积实现换肤

    

   

   

2.新建主题包

  

步骤如下:

1.右击主题包列表,选择"增加主题包",主题名和文件夹名都设置为themem1(此时会在themes文件夹下新建一个theme1文件夹)

2.右击theme1,选择增加img类型,增加"gif"和"png"两个类型(和theme0对应相同的类型)

1.gif

  

为主题包增加img,按前面的介绍,我们只需要在theme1主题包中加入对应的img,保持它们name和theme0的name相同,就可以实现换肤了(切换主题包)

2.gif

    

最后,记得ctrl+s保存下

   

  下一节教程:REDM基础教程18-换肤的几种方式

    

  

文章作者:hgy413
本文地址:https://hgy413.com/3910.html
版权所有 © 转载时必须以链接形式注明作者和原始出处!

7 Responses to “REDM设计器教程12-增加主题包”

  1. #1 g his 回复 | 引用 Post:2020-06-10 16:24

    Hey! I know this is kinda off topic however I’d figured I’d ask.
    Would you be interested in trading links or maybe guest
    writing a blog article or vice-versa? My website discusses a lot of the same topics as yours
    and I believe we could greatly benefit from each other. If you might be interested
    feel free to send me an e-mail. I look forward to hearing from you!

    Wonderful blog by the way!

  2. #2 have g 回复 | 引用 Post:2020-06-10 20:25

    Hello to all, since I am truly keen of reading this blog’s post to be updated regularly.

    It consists of fastidious stuff.

  3. #3 from g 回复 | 引用 Post:2020-06-11 13:38

    Woah! I’m really enjoying the template/theme of this blog.
    It’s simple, yet effective. A lot of times it’s hard to get that “perfect balance” between superb usability and visual appearance.
    I must say that you’ve done a very good job with this.
    Additionally, the blog loads extremely quick for me on Safari.
    Excellent Blog!

  4. #4 g your 回复 | 引用 Post:2020-06-11 18:08

    Hello! I’ve been reading your website for a while now and finally got the bravery to go ahead and
    give you a shout out from New Caney Tx! Just wanted to mention keep up the fantastic work!

  5. #5 g 回复 | 引用 Post:2020-06-12 22:58

    Every weekend i used to go to see this web site, because i wish for
    enjoyment, since this this site conations in fact nice funny
    data too.

  6. #6 www.111you.com 回复 | 引用 Post:2020-06-14 10:32

    May I simply just say what a relief to discover an individual who actually
    knows what they are discussing on the web. You actually realize how to bring
    an issue to light and make it important. More people should look at this
    and understand this side of your story. I was surprised that you are not more popular
    given that you most certainly have the gift.

  7. #7 g 回复 | 引用 Post:2020-06-15 18:33

    Right away I am going to do my breakfast, when having my
    breakfast coming again to read other news.

发表评论