コード例 #1
0
        public TMXIsoObjectsTest()
        {
            CCTMXTiledMap map = new CCTMXTiledMap("TileMaps/iso-test-objectgroup");

            AddChild(map, -1, kTagTileMap);

            CCSize s = map.ContentSize;

            CCLog.Log("ContentSize: {0}, {1}", s.Width, s.Height);

            var objectGroup = map.ObjectGroupNamed("Object Group 1");
            var objects     = objectGroup.Objects;

            var drawNode = new CCDrawNode();

            foreach (var dict in objects)
            {
                float x      = float.Parse(dict["x"]);
                float y      = float.Parse(dict["y"]);
                float width  = (dict.ContainsKey("width") ? float.Parse(dict["width"]) : 0f);
                float height = (dict.ContainsKey("height") ? float.Parse(dict["height"]) : 0f);

                var color = new CCColor4B(255, 255, 255, 255);

                drawNode.DrawRect(new CCRect(x, y, width, height), CCColor4B.Transparent, 1, color);
            }
            map.AddChild(drawNode, 10);
        }
コード例 #2
0
        public TMXOrthoZorder()
        {
            CCTMXTiledMap map = new CCTMXTiledMap("TileMaps/orthogonal-test-zorder");

            AddChild(map, 0, kTagTileMap);

            m_tamara = new CCSprite(pathSister1);
            map.AddChild(m_tamara, map.Children.Count);
            m_tamara.AnchorPoint = CCPoint.AnchorMiddleBottom;

            m_tamara.RepeatForever(move, back);

            Schedule(repositionSprite);
        }
コード例 #3
0
        public TMXIsoZorder()
        {
            CCTMXTiledMap map = new CCTMXTiledMap("TileMaps/iso-test-zorder");

            AddChild(map, 0, kTagTileMap);

            CCSize s = map.ContentSize;

            CCLog.Log("ContentSize: {0}, {1}", s.Width, s.Height);

            m_tamara = new CCSprite(pathSister1);
            map.AddChild(m_tamara, map.Children.Count);

            m_tamara.AnchorPoint = CCPoint.AnchorMiddleBottom;

            m_tamara.RepeatForever(move, back);

            Schedule(repositionSprite);
        }