|
static float | Lerp (float from, float to, float factor) |
| Lerp function that doesn't clamp the 'factor' in 0-1 range. More...
|
|
static int | ClampIndex (int val, int max) |
| Clamp the specified integer to be between 0 and below 'max'. More...
|
|
static int | RepeatIndex (int val, int max) |
| Wrap the index using repeating logic, so that for example +1 past the end means index of '1'. More...
|
|
static float | WrapAngle (float angle) |
| Ensure that the angle is within -180 to 180 range. More...
|
|
static float | Wrap01 (float val) |
| In the shader, equivalent function would be 'fract' More...
|
|
static int | HexToDecimal (char ch) |
| Convert a hexadecimal character to its decimal value. More...
|
|
static char | DecimalToHexChar (int num) |
| Convert a single 0-15 value into its hex representation. It's coded because int.ToString(format) syntax doesn't seem to be supported by Unity's Flash. It just silently crashes. More...
|
|
static string | DecimalToHex8 (int num) |
| Convert a decimal value to its hex representation. More...
|
|
static string | DecimalToHex24 (int num) |
| Convert a decimal value to its hex representation. It's coded because num.ToString("X6") syntax doesn't seem to be supported by Unity's Flash. It just silently crashes. string.Format("{0,6:X}", num).Replace(' ', '0') doesn't work either. It returns the format string, not the formatted value. More...
|
|
static string | DecimalToHex32 (int num) |
| Convert a decimal value to its hex representation. It's coded because num.ToString("X6") syntax doesn't seem to be supported by Unity's Flash. It just silently crashes. string.Format("{0,6:X}", num).Replace(' ', '0') doesn't work either. It returns the format string, not the formatted value. More...
|
|
static int | ColorToInt (Color c) |
| Convert the specified color to RGBA32 integer format. More...
|
|
static Color | IntToColor (int val) |
| Convert the specified RGBA32 integer to Color. More...
|
|
static string | IntToBinary (int val, int bits) |
| Convert the specified integer to a human-readable string representing the binary value. Useful for debugging bytes. More...
|
|
static Color | HexToColor (uint val) |
| Convenience conversion function, allowing hex format (0xRrGgBbAa). More...
|
|
static Rect | ConvertToTexCoords (Rect rect, int width, int height) |
| Convert from top-left based pixel coordinates to bottom-left based UV coordinates. More...
|
|
static Rect | ConvertToPixels (Rect rect, int width, int height, bool round) |
| Convert from bottom-left based UV coordinates to top-left based pixel coordinates. More...
|
|
static Rect | MakePixelPerfect (Rect rect) |
| Round the pixel rectangle's dimensions. More...
|
|
static Rect | MakePixelPerfect (Rect rect, int width, int height) |
| Round the texture coordinate rectangle's dimensions. More...
|
|
static Vector2 | ConstrainRect (Vector2 minRect, Vector2 maxRect, Vector2 minArea, Vector2 maxArea) |
| Constrain 'rect' to be within 'area' as much as possible, returning the Vector2 offset necessary for this to happen. This function is useful when trying to restrict one area (window) to always be within another (viewport). More...
|
|
static Bounds | CalculateAbsoluteWidgetBounds (Transform trans) |
| Calculate the combined bounds of all widgets attached to the specified game object or its children (in world space). More...
|
|
static Bounds | CalculateRelativeWidgetBounds (Transform trans) |
| Calculate the combined bounds of all widgets attached to the specified game object or its children (in relative-to-object space). More...
|
|
static Bounds | CalculateRelativeWidgetBounds (Transform trans, bool considerInactive) |
| Calculate the combined bounds of all widgets attached to the specified game object or its children (in relative-to-object space). More...
|
|
static Bounds | CalculateRelativeWidgetBounds (Transform relativeTo, Transform content) |
| Calculate the combined bounds of all widgets attached to the specified game object or its children (in relative-to-object space). More...
|
|
static Bounds | CalculateRelativeWidgetBounds (Transform relativeTo, Transform content, bool considerInactive) |
| Calculate the combined bounds of all widgets attached to the specified game object or its children (in relative-to-object space). More...
|
|
static Vector3 | SpringDampen (ref Vector3 velocity, float strength, float deltaTime) |
| This code is not framerate-independent: More...
|
|
static Vector2 | SpringDampen (ref Vector2 velocity, float strength, float deltaTime) |
| Same as the Vector3 version, it's a framerate-independent Lerp. More...
|
|
static float | SpringLerp (float strength, float deltaTime) |
| Calculate how much to interpolate by. More...
|
|
static float | SpringLerp (float from, float to, float strength, float deltaTime) |
| Mathf.Lerp(from, to, Time.deltaTime * strength) is not framerate-independent. This function is. More...
|
|
static Vector2 | SpringLerp (Vector2 from, Vector2 to, float strength, float deltaTime) |
| Vector2.Lerp(from, to, Time.deltaTime * strength) is not framerate-independent. This function is. More...
|
|
static Vector3 | SpringLerp (Vector3 from, Vector3 to, float strength, float deltaTime) |
| Vector3.Lerp(from, to, Time.deltaTime * strength) is not framerate-independent. This function is. More...
|
|
static Quaternion | SpringLerp (Quaternion from, Quaternion to, float strength, float deltaTime) |
| Quaternion.Slerp(from, to, Time.deltaTime * strength) is not framerate-independent. This function is. More...
|
|
static float | RotateTowards (float from, float to, float maxAngle) |
| Since there is no Mathf.RotateTowards... More...
|
|
static float | DistanceToRectangle (Vector2[] screenPoints, Vector2 mousePos) |
| Determine the distance from the mouse position to the screen space rectangle specified by the 4 points. More...
|
|
static float | DistanceToRectangle (Vector3[] worldPoints, Vector2 mousePos, Camera cam) |
| Determine the distance from the mouse position to the world rectangle specified by the 4 points. More...
|
|
static Vector2 | GetPivotOffset (UIWidget.Pivot pv) |
| Helper function that converts the widget's pivot enum into a 0-1 range vector. More...
|
|
static UIWidget.Pivot | GetPivot (Vector2 offset) |
| Helper function that converts the pivot offset to a pivot point. More...
|
|
static void | MoveWidget (UIRect w, float x, float y) |
| Adjust the widget's position using the specified local delta coordinates. More...
|
|
static void | MoveRect (UIRect rect, float x, float y) |
| Adjust the rectangle's position using the specified local delta coordinates. More...
|
|
static void | ResizeWidget (UIWidget w, UIWidget.Pivot pivot, float x, float y, int minWidth, int minHeight) |
| Given the specified dragged pivot point, adjust the widget's dimensions. More...
|
|
static void | ResizeWidget (UIWidget w, UIWidget.Pivot pivot, float x, float y, int minWidth, int minHeight, int maxWidth, int maxHeight) |
| Given the specified dragged pivot point, adjust the widget's dimensions. More...
|
|
static void | AdjustWidget (UIWidget w, float left, float bottom, float right, float top) |
| Adjust the widget's rectangle based on the specified modifier values. More...
|
|
static void | AdjustWidget (UIWidget w, float left, float bottom, float right, float top, int minWidth, int minHeight) |
| Adjust the widget's rectangle based on the specified modifier values. More...
|
|
static void | AdjustWidget (UIWidget w, float left, float bottom, float right, float top, int minWidth, int minHeight, int maxWidth, int maxHeight) |
| Adjust the widget's rectangle based on the specified modifier values. More...
|
|
static int | AdjustByDPI (float height) |
| Adjust the specified value by DPI: height * 96 / DPI. This will result in in a smaller value returned for higher pixel density devices. More...
|
|
static Vector2 | ScreenToPixels (Vector2 pos, Transform relativeTo) |
| Convert the specified position, making it relative to the specified object. More...
|
|
static Vector2 | ScreenToParentPixels (Vector2 pos, Transform relativeTo) |
| Convert the specified position, making it relative to the specified object's parent. Useful if you plan on positioning the widget using the specified value (think mouse cursor). More...
|
|
static Vector3 | WorldToLocalPoint (Vector3 worldPos, Camera worldCam, Camera uiCam, Transform relativeTo) |
| Convert the specified world point from one camera's world space to another, then make it relative to the specified transform. You should use this function if you want to position a widget using some 3D point in space. Pass your main camera for the "worldCam", and your UI camera for "uiCam", then the widget's transform for "relativeTo". You can then assign the widget's localPosition to the returned value. More...
|
|
static void | OverlayPosition (this Transform trans, Vector3 worldPos, Camera worldCam, Camera myCam) |
| Helper function that can set the transform's position to be at the specified world position. Ideal usage: positioning a UI element to be directly over a 3D point in space. More...
|
|
static void | OverlayPosition (this Transform trans, Vector3 worldPos, Camera worldCam) |
| Helper function that can set the transform's position to be at the specified world position. Ideal usage: positioning a UI element to be directly over a 3D point in space. More...
|
|
static void | OverlayPosition (this Transform trans, Transform target) |
| Helper function that can set the transform's position to be over the specified target transform. Ideal usage: positioning a UI element to be directly over a 3D object in space. More...
|
|