Table of Contents

Class SubTexture

Namespace
BSGameLib.Game.Textures
Assembly
BSGameLib.Game.dll

A part of another texture, which can be drawn as an image of its own. The pixels stay in ParentTexture; this holds the Region of them.

public class SubTexture : ITexture
Inheritance
SubTexture
Implements
Inherited Members

Constructors

SubTexture(ITexture)

Creates a sub-texture covering the whole of parentTexture.

public SubTexture(ITexture parentTexture)

Parameters

parentTexture ITexture

SubTexture(ITexture, Rectangle)

Creates a sub-texture covering location of parentTexture.

public SubTexture(ITexture parentTexture, Rectangle location)

Parameters

parentTexture ITexture
location Rectangle

SubTexture(ITexture, Vector2)

Creates a sub-texture from position to the parent's right and bottom edges.

public SubTexture(ITexture parentTexture, Vector2 position)

Parameters

parentTexture ITexture
position Vector2

SubTexture(ITexture, Vector2, Vector2)

Creates a sub-texture at position that is size pixels, each truncated to a whole number.

public SubTexture(ITexture parentTexture, Vector2 position, Vector2 size)

Parameters

parentTexture ITexture
position Vector2
size Vector2

Properties

ParentTexture

The texture this is a part of.

public ITexture ParentTexture { get; }

Property Value

ITexture

Region

The part of ParentTexture this covers, in pixels. Setting it changes what is drawn.

public TextureRegion Region { get; set; }

Property Value

TextureRegion

Methods

~SubTexture()

Releases the instance count. The parent texture is not disposed.

protected ~SubTexture()