当前位置: 首页>>代码示例>>C#>>正文


C# RectBox.GetHeight方法代码示例

本文整理汇总了C#中Loon.Core.Geom.RectBox.GetHeight方法的典型用法代码示例。如果您正苦于以下问题:C# RectBox.GetHeight方法的具体用法?C# RectBox.GetHeight怎么用?C# RectBox.GetHeight使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Loon.Core.Geom.RectBox的用法示例。


在下文中一共展示了RectBox.GetHeight方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Load

        private void Load(Stream ins0, string tileSetsLocation)
        {
            screenRect = LSystem.screenRect;

            tilesLocation = tileSetsLocation;

            try
            {
                XMLDocument doc = XMLParser.Parse(ins0);
                XMLElement docElement = doc.GetRoot();

                string orient = docElement.GetAttribute("orientation", "");
                if (!"orthogonal".Equals(orient))
                {
                    throw new Exception(
                            "Only orthogonal maps supported, found " + orient);
                }

                width = docElement.GetIntAttribute("width", 0);
                height = docElement.GetIntAttribute("height", 0);
                tileWidth = docElement.GetIntAttribute("tilewidth", 0);
                tileHeight = docElement.GetIntAttribute("tileheight", 0);

                XMLElement propsElement = (XMLElement)docElement
                        .GetChildrenByName("properties");
                if (propsElement != null)
                {
                    props = new TMXProperty();
                    List<XMLElement> property = propsElement.List("property");
                    for (int i = 0; i < property.Count; i++)
                    {
                        XMLElement propElement = property[i];
                        string name = propElement.GetAttribute("name", null);
                        string value_ren = propElement.GetAttribute("value", null);
                        props.SetProperty(name, value_ren);
                    }
                }

                if (loadTileSets)
                {
                    TMXTileSet tileSet = null;
                    TMXTileSet lastSet = null;

                    List<XMLElement> setNodes = docElement.List("tileset");
                    for (int i_0 = 0; i_0 < setNodes.Count; i_0++)
                    {
                        XMLElement current = setNodes[i_0];

                        tileSet = new TMXTileSet(this, current, true);
                        tileSet.index = i_0;

                        if (lastSet != null)
                        {
                            lastSet.SetLimit(tileSet.firstGID - 1);
                        }
                        lastSet = tileSet;

                        CollectionUtils.Add(tileSets, tileSet);
                    }
                }

                List<XMLElement> layerNodes = docElement.List("layer");
                for (int i_1 = 0; i_1 < layerNodes.Count; i_1++)
                {
                    XMLElement current_2 = layerNodes[i_1];
                    TMXLayer layer = new TMXLayer(this, current_2);
                    layer.index = i_1;

                    CollectionUtils.Add(layers, layer);
                }

                List<XMLElement> objectGroupNodes = docElement
                        .List("objectgroup");

                for (int i_3 = 0; i_3 < objectGroupNodes.Count; i_3++)
                {
                    XMLElement current_4 = objectGroupNodes[i_3];
                    TMXTileGroup objectGroup = new TMXTileGroup(current_4);
                    objectGroup.index = i_3;

                    CollectionUtils.Add(objectGroups, objectGroup);
                }

                defWidth = (int)(screenRect.GetWidth() / tileWidth);
                defHeight = (int)(screenRect.GetHeight() / tileHeight);

            }
            catch (Exception ex)
            {
                Console.Error.WriteLine(ex.StackTrace);
                throw new Exception("Failed to parse map", ex);
            }
        }
开发者ID:hellogithubtesting,项目名称:LGame,代码行数:93,代码来源:TMXTiledMap.cs

示例2: DrawChar

 protected internal void DrawChar(SpriteBatch batch, float x, float y, RectBox glyph,
         RectBox cropping, LColor color)
 {
     batch.Draw(texture, x + cropping.x, y + cropping.y, glyph.GetWidth(),
             glyph.GetHeight(), glyph.GetX(), glyph.GetY(),
             glyph.GetWidth(), glyph.GetHeight(), color);
 }
开发者ID:darragh-murphy,项目名称:LGame,代码行数:7,代码来源:SpriteFont.cs


注:本文中的Loon.Core.Geom.RectBox.GetHeight方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。