C# Class Gonzo.Elements.NineSlicer

A utility class for slicing an image into nine pieces (nineslicing).
ファイルを表示 Open project: Afr0Games/Project-Dollhouse

Public Properties

Property Type Description
BLeft Microsoft.Xna.Framework.Rectangle
CLeft Microsoft.Xna.Framework.Rectangle
LeftPadding int
TCenter_Scale Microsoft.Xna.Framework.Vector2
TLeft Microsoft.Xna.Framework.Rectangle
Width int

Public Methods

Method Description
Calculate ( float X, float Y, int LeftPadding, int RightPadding, int TopPadding, int BottomPadding ) : void

Calculates 9 patches of texture (from: http://gamedev.stackexchange.com/questions/115684/monogame-scale-resizing-texture-without-stretching-the-borders)

NineSlicer ( Vector2 Position, int TextureWidth, int TextureHeight, int LeftPadding, int RightPadding, int TopPadding, int BottomPadding ) : Files.Manager

Constructs a new NineSlicer instance.

ReScale ( float width, float height ) : void

Rescales this NinwSlicer to the specified width and height.

Method Details

Calculate() public method

Calculates 9 patches of texture (from: http://gamedev.stackexchange.com/questions/115684/monogame-scale-resizing-texture-without-stretching-the-borders)
public Calculate ( float X, float Y, int LeftPadding, int RightPadding, int TopPadding, int BottomPadding ) : void
X float X-position of texture.
Y float Y-position of texture.
LeftPadding int Amount of padding for left side.
RightPadding int Amount of padding for right side.
TopPadding int Amount of padding for top.
BottomPadding int Amount of padding for bottom.
return void

NineSlicer() public method

Constructs a new NineSlicer instance.
public NineSlicer ( Vector2 Position, int TextureWidth, int TextureHeight, int LeftPadding, int RightPadding, int TopPadding, int BottomPadding ) : Files.Manager
Position Microsoft.Xna.Framework.Vector2 Position of where to begin slicing the texture.
TextureWidth int Width of texture.
TextureHeight int Height of texture.
LeftPadding int Padding on the left.
RightPadding int Padding on the right.
TopPadding int Padding at the top.
BottomPadding int Padding at the bottom.
return Files.Manager

ReScale() public method

Rescales this NinwSlicer to the specified width and height.
public ReScale ( float width, float height ) : void
width float Width to scale to.
height float Height to scale to.
return void

Property Details

BLeft public_oe property

public Rectangle,Microsoft.Xna.Framework BLeft
return Microsoft.Xna.Framework.Rectangle

CLeft public_oe property

public Rectangle,Microsoft.Xna.Framework CLeft
return Microsoft.Xna.Framework.Rectangle

LeftPadding public_oe property

public int LeftPadding
return int

TCenter_Scale public_oe property

public Vector2,Microsoft.Xna.Framework TCenter_Scale
return Microsoft.Xna.Framework.Vector2

TLeft public_oe property

public Rectangle,Microsoft.Xna.Framework TLeft
return Microsoft.Xna.Framework.Rectangle

Width public_oe property

public int Width
return int