Semi Mod Loader
Public Member Functions | Public Attributes | List of all members
Semi.RuntimeAtlasPacker Class Reference

Public Member Functions

 RuntimeAtlasPacker (int width=0, int height=0, TextureFormat format=TextureFormat.RGBA32, int padding=2)
 
RuntimeAtlasSegment Pack (Texture2D tex, bool apply=false)
 Add the specified texture to the atlas. More...
 
RuntimeAtlasPage NewPage ()
 Creates a new page in the atlas. More...
 
void Apply ()
 Apply all changes on the underlying atlas texture. More...
 
bool IsPageTexture (Texture2D tex)
 

Public Attributes

List< RuntimeAtlasPagePages = new List<RuntimeAtlasPage>()
 
int Width
 
int Height
 
TextureFormat Format
 
int Padding
 
Action< RuntimeAtlasPageOnNewPage
 

Constructor & Destructor Documentation

◆ RuntimeAtlasPacker()

Semi.RuntimeAtlasPacker.RuntimeAtlasPacker ( int  width = 0,
int  height = 0,
TextureFormat  format = TextureFormat.RGBA32,
int  padding = 2 
)
inline

Member Function Documentation

◆ Apply()

void Semi.RuntimeAtlasPacker.Apply ( )
inline

Apply all changes on the underlying atlas texture.

◆ IsPageTexture()

bool Semi.RuntimeAtlasPacker.IsPageTexture ( Texture2D  tex)
inline

◆ NewPage()

RuntimeAtlasPage Semi.RuntimeAtlasPacker.NewPage ( )
inline

Creates a new page in the atlas.

Returns
The newly created page.

◆ Pack()

RuntimeAtlasSegment Semi.RuntimeAtlasPacker.Pack ( Texture2D  tex,
bool  apply = false 
)
inline

Add the specified texture to the atlas.

Returns
The newly created segment.
Parameters
texTexture to add.
applyIf set to true, will be applied after adding.

Member Data Documentation

◆ Format

TextureFormat Semi.RuntimeAtlasPacker.Format

◆ Height

int Semi.RuntimeAtlasPacker.Height

◆ OnNewPage

Action<RuntimeAtlasPage> Semi.RuntimeAtlasPacker.OnNewPage

◆ Padding

int Semi.RuntimeAtlasPacker.Padding

◆ Pages

List<RuntimeAtlasPage> Semi.RuntimeAtlasPacker.Pages = new List<RuntimeAtlasPage>()

◆ Width

int Semi.RuntimeAtlasPacker.Width

The documentation for this class was generated from the following file: