Beispiel #1
0
        public UIScrolledMap()
        {
            width = schemes.frameWidth;
            height = schemes.frameHeight;

            dragAble = true;//默认dragAble
            rotateAble = true;//默认dragAble
            scaleAble = true;//默认scaleAble
            mMapClient = appendFromXML(@"<map name='client'></map>") as UIMap;

            evtOnLMUp += (ui, x, y) =>
                {
                    showMini();
                    setDirty(true);
                    return false;
                };

            mMiniMapDiv = appendFromXML(@"
            <div name='mini' clip='true' padding='16' shrink='true' align='rightTop'>
            <rect size='128' fillColor='transparent' strokeColor='transparent'><map>
            </map></rect></div>") as UIBlank;
            mMiniMapRect = mMiniMapDiv.findByTag("rect") as UIRect;
            mMiniMap = mMiniMapRect.findByTag("map") as UIMap;
            mMiniMapRect.height = mMiniMapRect.width = mMiniMapSize;
            mMiniMapRect.alignParesent = EAlign.rightTop;

            mMiniMap.evtOnPostDraw += g =>
                {
                    mMapClient.doDraw(g);
                };

            string xmlWindow = string.Format(xmlFmt, 0, 0, 128, 128);

            //var childrenUi = mMiniMap.appendFromXML(xmlChildren);
            mMiniWinow = mMiniMap.appendFromXML(xmlWindow) as UIRect;
        }
Beispiel #2
0
        public static XmlNodeList fromXML(XmlNode node, out UIWidget ui, UIWidget p)
        {
            uint fc = 0;
            XmlNode ret = node.Attributes.GetNamedItem("color");
            string strRet = (ret == null) ? UIRoot.Instance.getPropertyInTable("color") : ((ret.Value == "NA") ? null : ret.Value);
            if (strRet != null)
            {
                fc = strRet.castHex(0xff888888);
                UIRoot.Instance.setPropertyInTable("color", ref strRet);
            }

            var m = new UIMap();
            m.color = fc;
            ui = m;
            ui.fromXML(node);
            ui.paresent = p;
            return node.ChildNodes;
        }