Class Tex2DSprite
- Namespace
- PAC
public static class Tex2DSprite
- Inheritance
-
Tex2DSprite
- Inherited Members
Methods
ApplyMask(Texture2D, IntVector2[])
public static Texture2D ApplyMask(Texture2D texture, IntVector2[] mask)
Parameters
texture
Texture2Dmask
IntVector2[]
Returns
- Texture2D
ApplyMask(Texture2D, Texture2D)
public static Texture2D ApplyMask(Texture2D texture, Texture2D mask)
Parameters
texture
Texture2Dmask
Texture2D
Returns
- Texture2D
BlankTexture(int, int)
public static Texture2D BlankTexture(int width, int height)
Parameters
Returns
- Texture2D
Blend(Color, Texture2D, BlendMode)
Overlays topColour onto each pixel of bottomTex using the given blend mode.
public static Texture2D Blend(Color topColour, Texture2D bottomTex, BlendMode blendMode)
Parameters
topColour
ColorbottomTex
Texture2DblendMode
BlendMode
Returns
- Texture2D
Blend(Texture2D, Texture2D, BlendMode)
Overlays topTex onto bottomTex using the given blend mode, placing the bottom-left corner on the bottom-left corner.
public static Texture2D Blend(Texture2D topTex, Texture2D bottomTex, BlendMode blendMode)
Parameters
topTex
Texture2DbottomTex
Texture2DblendMode
BlendMode
Returns
- Texture2D
Blend(Texture2D, Texture2D, IntVector2, BlendMode)
Overlays topTex onto bottomTex using the given blend mode, placing the bottom-left corner at the coordinates topTexOffset (which don't have to be within the image).
public static Texture2D Blend(Texture2D topTex, Texture2D bottomTex, IntVector2 topTexOffset, BlendMode blendMode)
Parameters
topTex
Texture2DbottomTex
Texture2DtopTexOffset
IntVector2blendMode
BlendMode
Returns
- Texture2D
ChangeRect(Texture2D, IntRect)
Changes the dimensions of the texture to the new rect.
public static Texture2D ChangeRect(Texture2D texture, IntRect newRect)
Parameters
texture
Texture2DnewRect
IntRectThe coords of the new rect relative to the coords of the old rect.
Returns
- Texture2D
CheckerboardBackground(int, int)
public static Texture2D CheckerboardBackground(int width, int height)
Parameters
Returns
- Texture2D
ContainsPixel(Texture2D, IntVector2)
public static bool ContainsPixel(this Texture2D texture, IntVector2 pixel)
Parameters
texture
Texture2Dpixel
IntVector2
Returns
ContainsPixel(Texture2D, int, int)
public static bool ContainsPixel(this Texture2D texture, int x, int y)
Parameters
Returns
Copy(Texture2D)
Creates a deepcopy of the texture using Color colours.
public static Texture2D Copy(Texture2D texture)
Parameters
texture
Texture2D
Returns
- Texture2D
Copy32(Texture2D)
Creates a deepcopy of the texture using Color32 colours.
public static Texture2D Copy32(Texture2D texture)
Parameters
texture
Texture2D
Returns
- Texture2D
Extend(Texture2D, int, int, int, int)
Adds the given number of transparent pixels to each side of the texture. Negative amounts will crop the image.
public static Texture2D Extend(Texture2D texture, int left, int right, int up, int down)
Parameters
Returns
- Texture2D
Fill(Texture2D, IntVector2, Color, int)
public static Texture2D Fill(Texture2D texture, IntVector2 startPoint, Color colour, int maxNumOfIterations = 1000000)
Parameters
texture
Texture2DstartPoint
IntVector2colour
ColormaxNumOfIterations
int
Returns
- Texture2D
Flip(Texture2D, FlipDirection)
public static Texture2D Flip(Texture2D texture, FlipDirection direction)
Parameters
texture
Texture2Ddirection
FlipDirection
Returns
- Texture2D
FlipX(Texture2D)
public static Texture2D FlipX(Texture2D texture)
Parameters
texture
Texture2D
Returns
- Texture2D
FlipY(Texture2D)
public static Texture2D FlipY(Texture2D texture)
Parameters
texture
Texture2D
Returns
- Texture2D
GetFillMask(Texture2D, IntVector2, int)
public static Texture2D GetFillMask(Texture2D texture, IntVector2 startPoint, int maxNumOfIterations = 100000)
Parameters
texture
Texture2DstartPoint
IntVector2maxNumOfIterations
int
Returns
- Texture2D
GetPixel(Texture2D, IntVector2)
public static Color GetPixel(this Texture2D texture, IntVector2 coords)
Parameters
texture
Texture2Dcoords
IntVector2
Returns
- Color
GetPixelsToFill(Texture2D, IntVector2, int)
public static IntVector2[] GetPixelsToFill(Texture2D texture, IntVector2 startPoint, int maxNumOfIterations = 100000)
Parameters
texture
Texture2DstartPoint
IntVector2maxNumOfIterations
int
Returns
HSLHueSaturationGrid(int, int)
public static Texture2D HSLHueSaturationGrid(int width, int height)
Parameters
Returns
- Texture2D
LoadFromFile(string)
public static Texture2D LoadFromFile(string filePath)
Parameters
filePath
string
Returns
- Texture2D
Multiply(Texture2D, Color)
public static Texture2D Multiply(Texture2D texture, Color colour)
Parameters
texture
Texture2Dcolour
Color
Returns
- Texture2D
Offset(Texture2D, IntVector2)
public static Texture2D Offset(Texture2D texture, IntVector2 offset)
Parameters
texture
Texture2Doffset
IntVector2
Returns
- Texture2D
Outline(Texture2D, Color, bool, OutlineSideFill)
Makes an outline around the non-transparent pixels of the given texture.
public static Texture2D Outline(Texture2D texture, Color outlineColour, bool outlineOutside, OutlineSideFill outlineSideFill)
Parameters
texture
Texture2DoutlineColour
ColoroutlineOutside
boolWhen true: the outline is created next to existing pixels (widens the sprite). When false: replaces the outer pixels.
outlineSideFill
OutlineSideFill
Returns
- Texture2D
Overlay(Texture2D, Texture2D)
Overlays topTex onto bottomTex, placing the bottom-left corner on the bottom-left corner. Uses Normal blend mode.
public static Texture2D Overlay(Texture2D topTex, Texture2D bottomTex)
Parameters
topTex
Texture2DbottomTex
Texture2D
Returns
- Texture2D
Overlay(Texture2D, Texture2D, IntVector2)
Overlays topTex onto bottomTex, placing the bottom-left corner at the coordinates topTexOffset (which don't have to be within the image). Uses Normal blend mode.
public static Texture2D Overlay(Texture2D topTex, Texture2D bottomTex, IntVector2 topTexOffset)
Parameters
topTex
Texture2DbottomTex
Texture2DtopTexOffset
IntVector2
Returns
- Texture2D
ReplaceColour(Texture2D, Color, Color)
public static Texture2D ReplaceColour(Texture2D texture, Color toReplace, Color replaceWith)
Parameters
texture
Texture2DtoReplace
ColorreplaceWith
Color
Returns
- Texture2D
Rotate(Texture2D, RotationAngle)
Rotation is clockwise.
public static Texture2D Rotate(Texture2D texture, RotationAngle angle)
Parameters
texture
Texture2Dangle
RotationAngle
Returns
- Texture2D
Rotate180(Texture2D)
public static Texture2D Rotate180(Texture2D texture)
Parameters
texture
Texture2D
Returns
- Texture2D
Rotate90(Texture2D)
Rotation is clockwise.
public static Texture2D Rotate90(Texture2D texture)
Parameters
texture
Texture2D
Returns
- Texture2D
RotateMinus90(Texture2D)
Rotation is clockwise.
public static Texture2D RotateMinus90(Texture2D texture)
Parameters
texture
Texture2D
Returns
- Texture2D
Scale(Texture2D, int, int)
public static Texture2D Scale(Texture2D texture, int newWidth, int newHeight)
Parameters
Returns
- Texture2D
Scale(Texture2D, float)
public static Texture2D Scale(Texture2D texture, float scaleFactor)
Parameters
texture
Texture2DscaleFactor
float
Returns
- Texture2D
Scale(Texture2D, float, float)
public static Texture2D Scale(Texture2D texture, float xScaleFactor, float yScaleFactor)
Parameters
Returns
- Texture2D
SetPixel(Texture2D, IntVector2, Color)
public static void SetPixel(this Texture2D texture, IntVector2 coords, Color colour)
Parameters
texture
Texture2Dcoords
IntVector2colour
Color
SolidTexture(int, int, Color)
Creates a texture of the given dimensions filled with the given colour.
NOTE: the overload that takes in a Color32 is faster.
public static Texture2D SolidTexture(int width, int height, Color colour)
Parameters
Returns
- Texture2D
SolidTexture(int, int, Color32)
Creates a texture of the given dimensions filled with the given colour.
NOTE: this is faster than the overload that takes in a Color.
public static Texture2D SolidTexture(int width, int height, Color32 colour)
Parameters
Returns
- Texture2D
Subtract(Texture2D, Texture2D)
public static Texture2D Subtract(Texture2D topTex, Texture2D bottomTex)
Parameters
topTex
Texture2DbottomTex
Texture2D
Returns
- Texture2D
Tex2DToSprite(Texture2D)
public static Sprite Tex2DToSprite(Texture2D tex)
Parameters
tex
Texture2D
Returns
- Sprite