C# Class ARCed.Helpers.Cache

Static class for loading graphic resources and caching them to increase performance. This class class also performs hue and opacity alterations on graphics.
Show file Open project: borisblizzard/arcreator

Public Methods

Method Description
Animation ( string filename, int hue, int opacity = 255 ) : Image

Loads/recalls a cached animation file and returns it

Autotile ( string filename, int hue, int opacity = 255 ) : Image

Loads/recalls a cached image autotile file and returns it

Battleback ( string filename, int hue, int opacity = 255 ) : Image

Loads/recalls a cached battleback file and returns it

Battler ( string filename, int hue, int opacity = 255 ) : Image

Loads/recalls a cached image battler file and returns it

ChangeHueOpacity ( Image image, int hue, int opacity ) : void

Rotates the hue and alters the opacity of an image. Using this method is more efficient than performing the actions separately.

Values out of range will be automatically corrected

ChangeOpacity ( Image image, int opacity ) : void

Changes the opacity of an image.

Values out of range will be automatically corrected

Character ( string filename, int hue, int opacity = 255 ) : Image

Loads/recalls a cached character file and returns it

CharacterStance ( string filename, int pattern, int direction, int hue, int opacity = 255 ) : Image

Returns a tile of a character graphic using the given pattern and direction

Clear ( ) : void

Disposes all cached images and clears all keys and values of the dictionary

Fog ( string filename, int hue, int opacity = 255 ) : Image

Loads/recalls a cached fog file and returns it

Icon ( string filename, int hue, int opacity = 255 ) : Image

Loads/recalls a cached image icon file and returns it

LoadBitmap ( string folder, string filename ) : Image

Loads a filename as a Image from the specified folder, or recalls a cached image, and returns it.

Panorama ( string filename, int hue, int opacity = 255 ) : Image

Loads/recalls a cached panorama file and returns it

RotateHue ( Image image, int hue ) : void

Rotates the hue of an image

Values out of range will be automatically corrected

Tileset ( string filename, int hue, int opacity = 255 ) : Image

Loads/recalls a cached tileset file and returns it

Method Details

Animation() public static method

Loads/recalls a cached animation file and returns it
public static Animation ( string filename, int hue, int opacity = 255 ) : Image
filename string Relative path of the animation graphic
hue int Hue rotation to apply to graphic, with 360 degrees of displacement
opacity int Opacity of the returned _srcTexture
return Image

Autotile() public static method

Loads/recalls a cached image autotile file and returns it
public static Autotile ( string filename, int hue, int opacity = 255 ) : Image
filename string Full path of the autotile graphic
hue int Hue rotation to apply to graphic, with 360 degrees of displacement
opacity int Opacity of the returned _srcTexture
return Image

Battleback() public static method

Loads/recalls a cached battleback file and returns it
public static Battleback ( string filename, int hue, int opacity = 255 ) : Image
filename string Full path of the battleback graphic
hue int Hue rotation to apply to graphic, with 360 degrees of displacement
opacity int Opacity of the returned image
return Image

Battler() public static method

Loads/recalls a cached image battler file and returns it
public static Battler ( string filename, int hue, int opacity = 255 ) : Image
filename string FullPath of the character graphic
hue int Hue rotation to apply to graphic, with 360 degrees of displacement
opacity int Opacity of the returned _srcTexture
return Image

ChangeHueOpacity() public static method

Rotates the hue and alters the opacity of an image. Using this method is more efficient than performing the actions separately.
Values out of range will be automatically corrected
public static ChangeHueOpacity ( Image image, int hue, int opacity ) : void
image Image Image to change
hue int Degree of hue displacement (0..360)
opacity int Opacity change to apply (0..255)
return void

ChangeOpacity() public static method

Changes the opacity of an image.
Values out of range will be automatically corrected
public static ChangeOpacity ( Image image, int opacity ) : void
image Image Image to change
opacity int Opacity change to apply (0..255)
return void

Character() public static method

Loads/recalls a cached character file and returns it
public static Character ( string filename, int hue, int opacity = 255 ) : Image
filename string Full path of the character graphic
hue int Hue rotation to apply to graphic, with 360 degrees of displacement
opacity int Opacity of the returned _srcTexture
return Image

CharacterStance() public static method

Returns a tile of a character graphic using the given pattern and direction
public static CharacterStance ( string filename, int pattern, int direction, int hue, int opacity = 255 ) : Image
filename string FullPath of the character graphic
pattern int Pattern of the character tile
direction int Direction of the character tile
hue int Hue rotation to apply to graphic, with 360 degrees of displacement
opacity int Opacity of the returned _srcTexture
return Image

Clear() public static method

Disposes all cached images and clears all keys and values of the dictionary
public static Clear ( ) : void
return void

Fog() public static method

Loads/recalls a cached fog file and returns it
public static Fog ( string filename, int hue, int opacity = 255 ) : Image
filename string Full path of the fog graphic
hue int Hue rotation to apply to graphic, with 360 degrees of displacement
opacity int Opacity of the returned _srcTexture
return Image

Icon() public static method

Loads/recalls a cached image icon file and returns it
public static Icon ( string filename, int hue, int opacity = 255 ) : Image
filename string Full path of the icon graphic
hue int Hue rotation to apply to graphic, with 360 degrees of displacement
opacity int Opacity of the returned _srcTexture
return Image

LoadBitmap() public static method

Loads a filename as a Image from the specified folder, or recalls a cached image, and returns it.
public static LoadBitmap ( string folder, string filename ) : Image
folder string Folder specifying where the image will be searched
filename string FullPath of the image, omitting extension
return Image

Panorama() public static method

Loads/recalls a cached panorama file and returns it
public static Panorama ( string filename, int hue, int opacity = 255 ) : Image
filename string Full path of the panorama graphic
hue int Hue rotation to apply to graphic, with 360 degrees of displacement
opacity int Opacity of the returned _srcTexture
return Image

RotateHue() public static method

Rotates the hue of an image
Values out of range will be automatically corrected
public static RotateHue ( Image image, int hue ) : void
image Image Image to change
hue int Degree of hue displacement (0..360)
return void

Tileset() public static method

Loads/recalls a cached tileset file and returns it
public static Tileset ( string filename, int hue, int opacity = 255 ) : Image
filename string Relative path of the tileset graphic
hue int Hue rotation to apply to graphic, with 360 degrees of displacement
opacity int Opacity of the returned _srcTexture
return Image