CCPoint is a class in the CocosSharp library of C#. It is used to represent a 2D point in a game world and has X and Y coordinates. Here are some examples of its usage:
Example 1: CCPoint point1 = new CCPoint(100, 200); CCPoint point2 = new CCPoint(-50, 300); CCPoint point3 = point1 + point2; // The result will be a new CCPoint with coordinates (50, 500)
This example creates three CCPoints with different coordinates and then performs addition on two of them. The resulting CCPoint has coordinates that are the sum of the individual CCPoints.
Example 2: CCPoint point1 = new CCPoint(0, 0); CCPoint point2 = new CCPoint(200, 200); float distance = CCPoint.Distance(point1, point2); // The distance will be 282.84
This example creates two CCPoints with coordinates and then uses the static method Distance to calculate the distance between them. The result is a float value representing the distance between the two points.
Package/Library: CocosSharp is the package/library that contains the CCPoint class.
C# (CSharp) CCPoint - 60 examples found. These are the top rated real world C# (CSharp) examples of CCPoint extracted from open source projects. You can rate examples to help us improve the quality of examples.