-
Notifications
You must be signed in to change notification settings - Fork 1
GameObject
Morasiu edited this page Jan 4, 2019
·
4 revisions
Class that represents object in scene. Contains:
PositionContentColorMask
public class GameObject- Creates empty game object at position
Vector2.Zero(0, 0).
public GameObject()- Crates game object at
positionwith givencontentand default (white)colorMask.
public GameObject(Vector2 position, string content)- Crates game object at
positionwith givencontentandcolorMask. SeeColorMaskfor more information.
public GameObject(Vector2 position, string content, string colorMask)- Crates game object at
positionwith givencontentandcolorMasksets to givenColor. SeeColorMaskfor more information.
public GameObject(Vector2 position, string content, char color)Represents current GameObject position. It cannot be less that (0, 0).
Position in equal to first
charposition, so it's top left corner.
public Vector2 Position { get; set; }-
ArgumentOutOfRangeException- throw, when at least one of coordinates is less than 0.
Repreents GameObject content in string.
public string Content { get; set; }Represents GameObject color mask in string, which should have same size as Content.
public string ColorMask { get; set; }Represent width of GameObject. Width is equal to the longest line in Content.
public int Width { get; }Represents height of GameObject. Height is equal to the number of lines in GameObject.Content.
public int HeightSets all ColorMask to given color.
public void SetColor(char color)color char
Color represented by char. Must be between 0 and 9;
-
ArgumentException- throw, ifcolorin not between 0 and 9