public WTPolygonSprite(WTPolygonData polygonData) { _element = Futile.atlasManager.GetElementWithName("Futile_White"); _isAlphaDirty = true; UpdateWithData(polygonData); }
// Call this method if you want to change the points of the polygon after it already exists. public void UpdateWithData(WTPolygonData newData) { this.polygonData = newData; if (polygonData != null) { RefreshVertices(); _triangleCount = this.polygonData.polygonTriangles.Length / 3; Init(FFacetType.Triangle, _element, _triangleCount); _isMatrixDirty = true; _isAlphaDirty = true; _areLocalVerticesDirty = true; Redraw(true, false); } }