internal ImgData AddRegion(System.Drawing.Point start, System.Drawing.Point end) { ImgData img = new ImgData(); img.Region = new Tool.TSystem.Primitive.Rect(start.X, start.Y, end.X, end.Y); img.Pivot = new TPoint(img.Region.Width / 2, img.Region.Height / 2); ImgList.Add(img); return img; }
public void UpdateSprite() { if (m_selectImgData == m_main.SelectSprite.ImgList[m_index]) return; m_selectImgData = m_main.SelectSprite.ImgList[m_index]; Invalidate(); }
public void Read(XmlNode spriteNode) { m_name = GenericXmlReader.ReadStringAttribute(spriteNode, "name"); m_path = GenericXmlReader.ReadStringAttribute(spriteNode, "path"); m_hasColorKey = GenericXmlReader.IsExistAttribute( spriteNode , "colorKey" ); if ( m_hasColorKey ) { m_colorKey = GenericXmlReader.ReadColorAttribute(spriteNode, "colorKey"); } if (GenericXmlReader.IsExistAttribute(spriteNode, "parts")) { m_isParts = GenericXmlReader.ReadBoolAttribute(spriteNode, "parts"); } if (GenericXmlReader.IsExistAttribute(spriteNode, "speed")) { m_speed = GenericXmlReader.ReadFloatAttribute(spriteNode, "speed"); m_isCircle = GenericXmlReader.ReadBoolAttribute(spriteNode, "circle"); } else { m_speed = 0; m_isCircle = false; } XmlNodeList imgNode = spriteNode.SelectNodes("img"); foreach (XmlNode node in imgNode) { ImgData img = new ImgData(); img.Pivot = GenericXmlReader.ReadPointAttribute(node, "pivot"); img.Region = GenericXmlReader.ReadRectAttribute(node, "region"); m_imgList.Add(img); } }