Game Development Reference
In-Depth Information
public double GetHeight()
{
// topleft - bottomleft
return _vertexPositions[0].Y - _vertexPositions[2].Y;
}
public void SetWidth(float width)
{
InitVertexPositions(GetCenter(), width, GetHeight());
}
public void SetHeight(float height)
{
InitVertexPositions(GetCenter(), GetWidth(), height);
}
public void SetPosition(double x, double y)
{
SetPosition(new Vector(x, y, 0));
}
public void SetPosition(Vector position)
{
InitVertexPositions(position, GetWidth(), GetHeight());
}
public void SetColor(Color color)
{
for (int i = 0; i < Sprite.VertexAmount; i++)
{
_vertexColors[i] = color;
}
}
public void SetUVs(Point topLeft, Point bottomRight)
{
// TopLeft, TopRight, BottomLeft
_vertexUVs[0] = topLeft;
_vertexUVs[1]= new Point(bottomRight.X, topLeft.Y);
_vertexUVs[2]= new Point(topLeft.X, bottomRight.Y);
// TopRight, BottomRight, BottomLeft
Search WWH ::




Custom Search