C# Class FSO.Common.Utils.TextureUtils

Mostrar archivo Open project: RHY3756547/FreeSO

Public Methods

Method Description
Clip ( GraphicsDevice gd, Microsoft.Xna.Framework.Graphics.Texture2D texture, Rectangle source ) : Microsoft.Xna.Framework.Graphics.Texture2D
Copy ( GraphicsDevice gd, Microsoft.Xna.Framework.Graphics.Texture2D texture ) : Microsoft.Xna.Framework.Graphics.Texture2D
CopyAlpha ( Microsoft.Xna.Framework.Graphics.Texture2D &TextureTo, Microsoft.Xna.Framework.Graphics.Texture2D TextureFrom ) : void
ManualTextureMask ( Microsoft.Xna.Framework.Graphics.Texture2D &Texture, uint ColorsFrom ) : void

Manually replaces a specified color in a texture with transparent black, thereby masking it.

ManualTextureMaskSingleThreaded ( Microsoft.Xna.Framework.Graphics.Texture2D &Texture, uint ColorsFrom ) : void
MaskFromTexture ( Microsoft.Xna.Framework.Graphics.Texture2D &Texture, Microsoft.Xna.Framework.Graphics.Texture2D Mask, uint ColorsFrom ) : void
MergeHorizontal ( GraphicsDevice gd ) : Microsoft.Xna.Framework.Graphics.Texture2D

Combines multiple textures into a single texture

MergeHorizontal ( GraphicsDevice gd, int tailPx ) : Microsoft.Xna.Framework.Graphics.Texture2D

Combines multiple textures into a single texture

Resize ( GraphicsDevice gd, Microsoft.Xna.Framework.Graphics.Texture2D texture, int newWidth, int newHeight ) : Microsoft.Xna.Framework.Graphics.Texture2D
Scale ( GraphicsDevice gd, Microsoft.Xna.Framework.Graphics.Texture2D texture, float scaleX, float scaleY ) : Microsoft.Xna.Framework.Graphics.Texture2D
TextureFromColor ( GraphicsDevice gd, Color color ) : Microsoft.Xna.Framework.Graphics.Texture2D
TextureFromColor ( GraphicsDevice gd, Color color, int width, int height ) : Microsoft.Xna.Framework.Graphics.Texture2D

Private Methods

Method Description
FreeBuffer ( uint buffer ) : void
GetBuffer ( int size ) : uint[]
TextureUtils ( ) : System

Method Details

Clip() public static method

public static Clip ( GraphicsDevice gd, Microsoft.Xna.Framework.Graphics.Texture2D texture, Rectangle source ) : Microsoft.Xna.Framework.Graphics.Texture2D
gd GraphicsDevice
texture Microsoft.Xna.Framework.Graphics.Texture2D
source Microsoft.Xna.Framework.Rectangle
return Microsoft.Xna.Framework.Graphics.Texture2D

Copy() public static method

public static Copy ( GraphicsDevice gd, Microsoft.Xna.Framework.Graphics.Texture2D texture ) : Microsoft.Xna.Framework.Graphics.Texture2D
gd GraphicsDevice
texture Microsoft.Xna.Framework.Graphics.Texture2D
return Microsoft.Xna.Framework.Graphics.Texture2D

CopyAlpha() public static method

public static CopyAlpha ( Microsoft.Xna.Framework.Graphics.Texture2D &TextureTo, Microsoft.Xna.Framework.Graphics.Texture2D TextureFrom ) : void
TextureTo Microsoft.Xna.Framework.Graphics.Texture2D
TextureFrom Microsoft.Xna.Framework.Graphics.Texture2D
return void

ManualTextureMask() public static method

Manually replaces a specified color in a texture with transparent black, thereby masking it.
public static ManualTextureMask ( Microsoft.Xna.Framework.Graphics.Texture2D &Texture, uint ColorsFrom ) : void
Texture Microsoft.Xna.Framework.Graphics.Texture2D The texture on which to apply the mask.
ColorsFrom uint
return void

ManualTextureMaskSingleThreaded() public static method

public static ManualTextureMaskSingleThreaded ( Microsoft.Xna.Framework.Graphics.Texture2D &Texture, uint ColorsFrom ) : void
Texture Microsoft.Xna.Framework.Graphics.Texture2D
ColorsFrom uint
return void

MaskFromTexture() public static method

public static MaskFromTexture ( Microsoft.Xna.Framework.Graphics.Texture2D &Texture, Microsoft.Xna.Framework.Graphics.Texture2D Mask, uint ColorsFrom ) : void
Texture Microsoft.Xna.Framework.Graphics.Texture2D
Mask Microsoft.Xna.Framework.Graphics.Texture2D
ColorsFrom uint
return void

MergeHorizontal() public static method

Combines multiple textures into a single texture
public static MergeHorizontal ( GraphicsDevice gd ) : Microsoft.Xna.Framework.Graphics.Texture2D
gd GraphicsDevice
return Microsoft.Xna.Framework.Graphics.Texture2D

MergeHorizontal() public static method

Combines multiple textures into a single texture
public static MergeHorizontal ( GraphicsDevice gd, int tailPx ) : Microsoft.Xna.Framework.Graphics.Texture2D
gd GraphicsDevice
tailPx int
return Microsoft.Xna.Framework.Graphics.Texture2D

Resize() public static method

public static Resize ( GraphicsDevice gd, Microsoft.Xna.Framework.Graphics.Texture2D texture, int newWidth, int newHeight ) : Microsoft.Xna.Framework.Graphics.Texture2D
gd GraphicsDevice
texture Microsoft.Xna.Framework.Graphics.Texture2D
newWidth int
newHeight int
return Microsoft.Xna.Framework.Graphics.Texture2D

Scale() public static method

public static Scale ( GraphicsDevice gd, Microsoft.Xna.Framework.Graphics.Texture2D texture, float scaleX, float scaleY ) : Microsoft.Xna.Framework.Graphics.Texture2D
gd GraphicsDevice
texture Microsoft.Xna.Framework.Graphics.Texture2D
scaleX float
scaleY float
return Microsoft.Xna.Framework.Graphics.Texture2D

TextureFromColor() public static method

public static TextureFromColor ( GraphicsDevice gd, Color color ) : Microsoft.Xna.Framework.Graphics.Texture2D
gd GraphicsDevice
color Color
return Microsoft.Xna.Framework.Graphics.Texture2D

TextureFromColor() public static method

public static TextureFromColor ( GraphicsDevice gd, Color color, int width, int height ) : Microsoft.Xna.Framework.Graphics.Texture2D
gd GraphicsDevice
color Color
width int
height int
return Microsoft.Xna.Framework.Graphics.Texture2D