首页 > REDM基础教程 > REDM基础教程4-内置皮肤介绍
2016十月21

REDM基础教程4-内置皮肤介绍

[隐藏]

DM内置了三种皮肤实现,我们可以根据需要注册新的皮肤实现

   

1.状态连图

   

custombutton.png

对应的皮肤XML如下:

<imglist 
id="custombutton"     // 唯一标识skin类对象
src="png:custombutton"
states="3"            // 3种状态的连图
btitle="0"            // 0表示使用拉伸绘制,1表示平铺绘制,默认为0
bvert="0"             // 0表示是这是水平的状态连图,1表示这是坚直的状态连图,默认为0
commit="通用按钮"/>

这里大家会有个疑问,怎么通过上面的XML来找到这张图片所在的路径?,使用下面这个标识

src="png:custombutton" 

DM的内置Res包,会通过png:custombutton去各主题包中查找图片的路径,如MyRes资源包下的theme0主题包的dmindex.xml:

<resource>
	<png>//前缀匹配png
		<file name="closebutton" path="themes\theme0\image\closebutton.png" />
		<file name="maxbutton" path="themes\theme0\image\maxbutton.png" />
		<file name="restorebutton" path="themes\theme0\image\restorebutton.png" />
		<file name="minbutton" path="themes\theme0\image\minbutton.png" />
		<file name="custombutton" path="themes\theme0\image\custombutton.png" />// name匹配custombutton
	</png>
</resource>

可以看出,前缀匹配png,name匹配custombutton,从而找到对应的图片路径为:MyRes\\theme0\\  + themes\theme0\image\custombutton.png

主题包的查找顺序是,先从默认主题包中查找,如果没找到,则从其他主题包中顺次查找(默认开启循环查找功能),所以修改默认主题包即可实现换肤

  

  

2.9宫格

  

1.png


9宫格图的拉升规则如下

1.保证四个角1,3,9,7不做任何拉伸

2.与四个角有公共边的四个矩形2,6,8,4做单向拉伸,即保证与四个角的公共边不拉伸,2,8只进行横向拉伸,4,6只进行纵向拉伸

3.中间部分5做双向拉伸,即横向,纵向同时拉伸

9宫格是状态连图的子类,所以状态连图的所有属性,9宫格都拥有

示例qqdemo的背景就是使用了9宫格:

<img9   
 id="bg" 
 src="PNG:bg" 
 states="1"            // 1种状态的连图  
 btitle="0"            // 0表示使用拉伸绘制,1表示平铺绘制,默认为0
 bvert="0"             // 0表示是这是水平的状态连图,1表示这是坚直的状态连图,默认为0
 margin="482,260,0,0"  
 commit="主背景图"/>

它相对于状态连图多了一个属性

margin="482,260,0,0" 

四个坐标从左到右对应9宫格的左上右下四个边框,上述配置意思就是保持(0,0482,260)这块红色区域不变化

1.png

来看看动图:

4.gif

   

   

3.滚动条连图

 

滚动条是一种特殊的状态连图

控件:上箭头、下箭头、坚直滚动条、竖直滑槽、左箭头、右箭头、水平滚动条、水平滑槽、小边角

状态:正常、停留、点击、禁用、非Active

共9列*5行=45种状态,每一种状态都是一个9宫格

也支持三列或四列,此时禁用、非Active列被视为正常列(下图每个状态为16*16大小,水平宽度为9*16,竖直高度为5*16)

scrollbar.png

<scrollbar 
id="scrollbar" 
src="PNG:scrollbar" 
states="1"
margin="2,2,2,2"  // 每一种状态都是一个9宫格绘制
commit="滚动条图"/>

    

   

     

下一节教程:REDM设计器教程6-调整主窗口大小,增加新控件

    

    

 

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

25 Responses to “REDM基础教程4-内置皮肤介绍”

  1. #1 minecraft 回复 | 引用 Post:2018-10-04 00:54

    Link exchange is nothing else except it is just placing the other person’s website link on your
    page at proper place and other person will also do similar in favor of you.

  2. #2 minecraft 回复 | 引用 Post:2018-10-06 10:19

    This paragraph provides clear idea in support of the new
    visitors of blogging, that really how to do blogging.

  3. #3 minecraft 回复 | 引用 Post:2018-10-06 19:39

    Hello, Neat post. There is an issue along with your site in web explorer, may test this?
    IE still is the marketplace leader and a large component
    of people will miss your wonderful writing because of this problem.

  4. Attractive part of content. I just stumbled upon your web site and in accession capital to say that I
    acquire in fact enjoyed account your blog posts.
    Anyway I will be subscribing for your augment and even I achievement you get right of entry to consistently fast.

  5. Hello, Neat post. There’s a problem with your website in internet
    explorer, might check this? IE nonetheless is the marketplace chief and a large element of people will pass over your great writing
    because of this problem.

  6. Terrific work! This is the kind of information that should be
    shared around the internet. Shame on Google for not positioning this submit higher!
    Come on over and visit my site . Thanks =)

  7. Hello there! Would you mind if I share your blog with my myspace group?

    There’s a lot of folks that I think would really enjoy your
    content. Please let me know. Thanks

  8. What’s up to all, how is everything, I think every one is getting more from this web
    page, and your views are pleasant in favor of new people.

  9. #9 quest bars cheap 回复 | 引用 Post:2018-11-03 02:31

    I’ll right away snatch your rss as I can’t find your email subscription link or
    newsletter service. Do you’ve any? Kindly let me recognize in order that I may subscribe.
    Thanks.

  10. #10 quest bars cheap 回复 | 引用 Post:2018-11-03 20:21

    I’m not sure why but this site is loading very slow for
    me. Is anyone else having this issue or is it a problem on my end?

    I’ll check back later and see if the problem still exists.

  11. I’ve been surfing on-line greater than 3 hours these days,
    but I never found any attention-grabbing article like yours.
    It is beautiful worth sufficient for me. In my view, if all website owners and bloggers made good
    content material as you probably did, the web will likely be a lot more useful than ever before.

  12. #12 Sling TV 回复 | 引用 Post:2018-11-14 19:01

    I used to be able to find good information from your articles.

  13. #13 Sling TV 回复 | 引用 Post:2018-11-15 11:48

    hi!,I love your writing so much! share we communicate extra approximately your post on AOL?
    I need a specialist on this area to unravel my problem.
    Maybe that is you! Looking ahead to look you.

  14. I’m really loving the theme/design of your web site.
    Do you ever run into any web browser compatibility issues?
    A handful of my blog readers have complained about my blog not
    operating correctly in Explorer but looks great in Opera.
    Do you have any suggestions to help fix this problem?

  15. What’s Taking place i’m new to this, I stumbled upon this I’ve discovered It absolutely
    helpful and it has helped me out loads. I’m hoping to give a
    contribution & aid other users like its helped me.
    Good job.

  16. #16 descargar facebook 回复 | 引用 Post:2018-11-22 05:36

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

  17. #17 nagels 回复 | 引用 Post:2019-02-11 05:34

    Good response in return of this issue with firm arguments and telling the whole thing concerning that.

  18. I am not certain the place you are getting your information, but good topic.

    I needs to spend a while learning much more or figuring out more.

    Thanks for fantastic information I used to be searching for this info for my mission.

  19. #19 caldeiras-matosinhos.pt 回复 | 引用 Post:2020-05-10 14:23

    Hurrah, that’s what I was exploring for, what a information! present here at this webpage, thanks admin of this site.

  20. Howdy! I’m at work browsing your blog from my new
    iphone! Just wanted to say I love reading your blog
    and look forward to all your posts! Carry on the superb work!

  21. #21 well g 回复 | 引用 Post:2020-06-10 11:59

    We stumbled over here coming from a different web page
    and thought I might check things out. I like what I see so i am just following
    you. Look forward to looking into your web page yet again.

  22. #22 tinyurl.com 回复 | 引用 Post:2020-06-14 04:03

    Hey there would you mind sharing which blog platform you’re using?
    I’m looking to start my own blog in the near future but I’m having
    a difficult time making a decision between BlogEngine/Wordpress/B2evolution and
    Drupal. The reason I ask is because your design seems different then most blogs and I’m looking for something completely unique.
    P.S Apologies for being off-topic but I had to ask!

  23. Thankfulness to my father who informed me regarding this weblog, this website is genuinely
    awesome.

  24. #24 www.baijialuntan.net 回复 | 引用 Post:2020-06-14 14:32

    Do you have any video of that? I’d care to find out more details.

  25. #25 g 回复 | 引用 Post:2020-06-15 07:56

    Howdy! This is my first visit to your blog!
    We are a team of volunteers and starting a new project in a
    community in the same niche. Your blog provided us valuable information to work on. You have done a wonderful job!

发表评论