CCUtils
CCUtils
Cocos2DInheritance: System.Object
Constructors
CCUtils()
CCUtils()()
Methods
CCCardinalSplineAt(CCPoint, CCPoint, CCPoint, CCPoint, float, float)
Cocos2D.CCPoint CCCardinalSplineAt(CCPoint, CCPoint, CCPoint, CCPoint, float, float)(Cocos2D.CCPoint p0, Cocos2D.CCPoint p1, Cocos2D.CCPoint p2, Cocos2D.CCPoint p3, System.Single tension, System.Single t)
Returns the Cardinal Spline position for a given set of control points, tension and time
Parameters:
p0
(Cocos2D.CCPoint)p1
(Cocos2D.CCPoint)p2
(Cocos2D.CCPoint)p3
(Cocos2D.CCPoint)tension
(System.Single)t
(System.Single)Returns:
Cocos2D.CCPoint
Example
CCNextPOT(int)
System.Int32 CCNextPOT(int)(System.Int32 x)
Returns the next Power of Two for the given value. If x = 3, then this returns 4. If x = 4 then 4 is returned. If the value is a power of two, then the same value is returned.
Parameters:
x
(System.Int32) - The base of the POT testReturns:
System.Int32
- The next power of 2 (1, 2, 4, 8, 16, 32, 64, 128, etc)Example
CCNextPOT(long)
System.Int64 CCNextPOT(long)(System.Int64 x)
Returns the next Power of Two for the given value. If x = 3, then this returns 4. If x = 4 then 4 is returned. If the value is a power of two, then the same value is returned.
Parameters:
x
(System.Int64) - The base of the POT testReturns:
System.Int64
- The next power of 2 (1, 2, 4, 8, 16, 32, 64, 128, etc)Example
CCParseFloat(string)
System.Single CCParseFloat(string)(System.String toParse)
Parses a float value using the default number style and the invariant culture parser.
Parameters:
toParse
(System.String) - The value to parseReturns:
System.Single
- The float value of the string.Example
CCParseFloat(string, NumberStyles)
System.Single CCParseFloat(string, NumberStyles)(System.String toParse, System.Globalization.NumberStyles ns)
Parses a float value for the given string using the given number style and using the invariant culture parser.
Parameters:
toParse
(System.String) - The value to parse.ns
(System.Globalization.NumberStyles) - The number style used to parse the float value.Returns:
System.Single
- The float value of the string.Example
CCParseInt(string)
System.Int32 CCParseInt(string)(System.String toParse)
Parses an int value using the default number style and the invariant culture parser.
Parameters:
toParse
(System.String) - The value to parseReturns:
System.Int32
- The int value of the stringExample
CCParseInt(string, NumberStyles)
System.Int32 CCParseInt(string, NumberStyles)(System.String toParse, System.Globalization.NumberStyles ns)
Parses aint value for the given string using the given number style and using the invariant culture parser.
Parameters:
toParse
(System.String) - The value to parse.ns
(System.Globalization.NumberStyles) - The number style used to parse the int value.Returns:
System.Int32
- The int value of the string.Example
GetGLExtensions()
System.Collections.Generic.ListSystem.String GetGLExtensions()()
Returns:
System.Collections.Generic.ListSystem.String
Split(string, string, List)
Split(string, string, List)(System.String src, System.String token, System.Collections.Generic.ListSystem.String vect)
Parameters:
src
(System.String)token
(System.String)vect
(System.Collections.Generic.ListSystem.String)SplitWithForm(string, List)
System.Boolean SplitWithForm(string, List)(System.String pStr, System.Collections.Generic.ListSystem.String strs)
Parameters:
pStr
(System.String)strs
(System.Collections.Generic.ListSystem.String)Returns:
System.Boolean