• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            Error

            C++博客 首頁 新隨筆 聯(lián)系 聚合 管理
              217 Posts :: 61 Stories :: 32 Comments :: 0 Trackbacks
            參考了:cegui 魔獸世界  迅雷  mygui
            主要問題如下:
            Q1: 控件的屬性是放到xml節(jié)點的屬性中,還是作為子節(jié)點。放到屬性中方便,但是xml太長,人眼看的時候費勁,子節(jié)點會好很多。
            Q2: 控件之間的父子關(guān)系是直接用xml的節(jié)點父子關(guān)系來表達,還是和魔獸世界一樣允許parent="UIParent",這樣設(shè)置。我可能還需要“include”其他xml中定義的控件?
            直接xml父子節(jié)點:優(yōu)勢是關(guān)系簡單明了,缺陷是UI復(fù)雜以后堆積的xml文件太長,人眼也無法看明白了
            魔獸世界:他們的做法可以分離每個控件出來,但是層次關(guān)系又不明朗了。
            允許類似<Window></InsertControlByName name="ChirdControl" type="Type"></Window>這樣的特殊節(jié)點,平衡兩者有優(yōu)劣勢。但是名字空間還是需要非常留意的點。
            另外可以支持<ExportControls></Window name="ExportWnd"></ExportControls>,<InportControls></InportControl name="Import" type="Type" ImportFile="xxx.xml"><InportControls>
            type屬性不必要,但是加上以后可以讓xml自校驗?zāi)芰Ω鼜?br />
            解決名字沖突還是沒什么辦法。但是庫必須提供名字無關(guān)的控件消息綁定手段!允許全局重復(fù)名字的控件




            <GUILayout version="4" >
                <Window type="Generic/Image" name="GameOverRoot" >
                    <Property name="Area" value="{{0,0},{0,0},{1,0},{1,0}}" />
                    <Property name="Image" value="HUDDemo/Filler" />
                    <Property name="MaxSize" value="{{1,0},{1,0}}" />
                    <Property name="AlwaysOnTop" value="True" />
                    <Property name="ImageColours" value="tl:88888888 tr:88888888 bl:88888888 br:88888888" />
                    <Window type="Generic/Image" name="GameOverImage" >
                        <Property name="Area" value="{{0,0},{0.119444,0},{0,0},{0.519444,0}}" />
                        <Property name="MaxSize" value="{{1,0},{1,0}}" />
                        <Property name="AspectMode" value="Expand" />
                        <Property name="AspectRatio" value="1.923" />
                        <Property name="HorizontalAlignment" value="Centre" />
                    </Window>
                    <Window type="Generic/ImageButton" name="ButtonRestart" >
                        <Property name="Area" value="{{0,0},{0.597222,0},{0.153906,0},{0.661111,0}}" />
                        <Property name="HoverImage" value="HUDDemo/ButtonNormal" />
                        <Property name="NormalImage" value="HUDDemo/ButtonNormal" />
                        <Property name="PushedImage" value="HUDDemo/ButtonPressed" />
                        <Property name="DisabledImage" value="HUDDemo/ButtonNormal" />
                        <Property name="HorizontalAlignment" value="Centre" />
                        <Window type="Generic/Label" name="LabelRestart" >
                            <Property name="Area" value="{{0,0},{0.152778,0},{1,0},{1,0}}" />
                            <Property name="Font" value="GreatVibes-22" />
                            <Property name="Text" value="Restart" />
                            <Property name="MaxSize" value="{{1,0},{1,0}}" />
                            <Property name="NormalTextColour" value="FFFFFFFF" />
                            <Property name="DisabledTextColour" value="FFFFFFFF" />
                            <Property name="MousePassThroughEnabled" value="True" />
                        </Window>
                    </Window>
                </Window>
            </GUILayout>



            <Framename="EnterLeaveTest" parent="UIParent">

                         <Size x="100" y="100" />

                         <Anchors>

                                <Anchor point="CENTER"relativePoint="CENTER" relativeTo="UIParent" />

                         </Anchors>

                         <Layers>

                                <Layer level="BACKGROUND">

                                       <Texture name="$parentIcon"file="Interface\Icons\Spell_ShadowWordPain" setAllPoints="true"/>

                                </Layer>

                         </Layers>

                         <Scripts>

                                <OnEnter>

                                       ChatFrame1:AddMessage("++ 進入窗體:" .. self:GetName())

                                </OnEnter>

                                <OnLeave>

                                       ChatFrame1:AddMessage("-- 離開窗體:" .. self:GetName())

                                </OnLeave>

                         </Scripts>

                  </Frame>






            <xlue>
            <control class="BoltFox.MainMenu.Item">
            <attr_def>
            <attr name="SubMenuTemplate" type="string"/>
            <attr name="Text" type="string"/>
            </attr_def>
            <method_def>
            <SetContainer file="MainMenu.xml.lua" func="MainMenu_Item_SetContainer"/>
            <PopupSubMenu file="MainMenu.xml.lua" func="MainMenu_Item_PopupSubMenu"/>
            <DestroySubMenu file="MainMenu.xml.lua" func="MainMenu_Item_DestroySubMenu"/>
            <SetEntered file="MainMenu.xml.lua" func="MainMenu_Item_SetEntered"/>
            <SetText file="MainMenu.xml.lua" func="MainMenu_Item_SetText"/>
            <GetText file="MainMenu.xml.lua" func="MainMenu_Item_GetText"/>
            </method_def>
            <event_def>
            <OnSelected />
            </event_def>
            <objtemplate>
            <children>
            <obj id="root" class="LayoutObject">
            <attr>
            <left>0</left>
            <top>0</top>
            <width>father.width</width>
            <height>father.height</height>
            </attr>
            <children>
            <obj id="hoverBkg" class="FillObject">
            <attr>
            <left>0</left>
            <top>0</top>
            <width>father.width</width>
            <height>father.height</height>
            <visible>false</visible>
            <filltype>singlecolor</filltype>
            <srccolor>235,0,0,155</srccolor>
            </attr>
            <children>
            <obj id="tosub" class="ImageObject">
            <attr>
            <left>10</left>
            <top>4</top>
            <width>father.width - 10</width>
            <height>5</height>
            <visible>false</visible>
            <image>bitmap.right.triangle</image>
            </attr>
            </obj>
            <obj id="text" class="TextObject">
            <attr>
            <left>10</left>
            <top>3</top>
            <width>father.width - 15</width>
            <height>father.height - 6</height>
            </attr>
            </obj>
            </children>
            </obj>
            </children>
            </obj>
            </children>
            <eventlist>
            <event name="OnMouseEnter" file="MainMenu.xml.lua" func="MainMenu_Item_OnMouseEnter"/>
            <event name="OnMouseLeave" file="MainMenu.xml.lua" func="MainMenu_Item_OnMouseLeave"/>
            <event name="OnLButtonDown" file="MainMenu.xml.lua" func="MainMenu_Item_OnLButtonDown"/>
            <event name="OnInitControl" file="MainMenu.xml.lua" func="MainMenu_Item_OnInitControl"/>
            </eventlist>
            </objtemplate>
            </control>



            <?xml version="1.0" encoding="UTF-8"?>
            <MyGUI type="Layout" version="3.2.0">
                <Widget type="Window" skin="WindowC" position="20 20 170 135" layer="Info" name="Root">
                    <Property key="Snap" value="true"/>
                    <UserString key="ButtonSkin" value="Button"/>
                    <Widget type="ImageBox" skin="ImageBox" position="5 5 50 50" name="Icon">
                        <Property key="ImageResource" value="MessageBoxIcon"/>
                        <Property key="ImageGroup" value="Icons"/>
                    </Widget>
                    <Widget type="TextBox" skin="TextBox" position="60 5 92 50" align="Stretch" name="Text">
                        <Property key="TextAlign" value="Left VCenter"/>
                    </Widget>
                    <Widget type="Widget" skin="PanelEmpty" position="20 60 120 26" align="HStretch Bottom" name="ButtonPlace">
                        <Widget type="Button" skin="Button" position="10 0 100 26" name="ButtonTemplate"/>
                    </Widget>
                </Widget>
            </MyGUI>
            posted on 2014-06-24 11:45 Enic 閱讀(353) 評論(0)  編輯 收藏 引用 所屬分類: 從零開始寫棋牌游戲平臺
            久久久WWW成人免费精品| 色偷偷88888欧美精品久久久| 亚洲精品国产字幕久久不卡| 精品久久久久久无码中文野结衣| 国产99精品久久| 久久精品国产半推半就| 99久久成人国产精品免费| 精品国产91久久久久久久| 久久线看观看精品香蕉国产| 97超级碰碰碰碰久久久久| 青青青国产成人久久111网站| 99久久精品无码一区二区毛片| 欧美伊香蕉久久综合类网站| 国产成人精品综合久久久| 久久嫩草影院免费看夜色| 国产一区二区久久久| 久久婷婷五月综合97色| 久久不见久久见免费视频7| 久久最近最新中文字幕大全| 久久精品18| 亚洲精品乱码久久久久久蜜桃图片 | 久久久久夜夜夜精品国产| 91精品国产91久久久久久蜜臀| 国产精品嫩草影院久久| 久久综合久久综合亚洲| 色欲综合久久中文字幕网| 日本久久久精品中文字幕| 日韩久久久久中文字幕人妻| 亚洲国产精品无码久久久秋霞2 | 欧美精品国产综合久久| 国产精品美女久久久久久2018| 亚洲国产精品人久久| 香蕉久久久久久狠狠色| 久久香蕉国产线看观看乱码| 亚洲欧美日韩久久精品| 国产精品久久久久久福利69堂| 久久久WWW成人免费毛片| 久久精品国产亚洲AV麻豆网站 | 久久精品国产亚洲Aⅴ香蕉| 性欧美丰满熟妇XXXX性久久久 | 精品久久久久久国产|