Represents the location of an image on an atlas.
Public Member Functions | |
AtlasLocation (TextureAtlas atlas, int x, int y, int width, int height) | |
Creates a new location on the given atlas with the given size. More... | |
AtlasLocation (int x, int y, int width, int height, float imageWidth, float imageHeight) | |
Creates a new atlas location without an atlas. More... | |
AtlasLocation (float imageWidth, float imageHeight) | |
A fixed atlas location with 0->1 UV's. More... | |
void | UpdateFixed (float imageWidth, float imageHeight) |
Updates a fixed image location. More... | |
void | PreventDeallocation () |
Blocks this location from ever getting deallocated from being no longer "in use". More... | |
bool | DecreaseUsage () |
Called when an instance of the image goes offscreen. More... | |
void | Deselect () |
Empties this location and frees it up for use by other textures. More... | |
void | AddToEmptySet () |
Adds this location to the set of empty locations on the atlas. This allows other textures to use this space on the atlas. More... | |
int | FitFactor (int width, int height, int area) |
A value which represents how well the given image dimensions fit in this location. Select the location with this as close to zero as possible. It's essentially pixels wasted using this location. More... | |
void | Select (AtlasEntity image, int width, int height, int spacing) |
This texture has selected this location to fit into. This adds it to the atlas. More... | |
void | OptimiseSelect (AtlasLocation location) |
Used during the optimise process. This texture has selected this location to fit into. This adds it to the atlas. More... | |
float | GetU (float atPixel) |
Gets the horizontal component of the UV co-ordinate of the given pixel. More... | |
float | GetV (float atPixel) |
Gets the vertical component of the UV co-ordinate of the given pixel. More... | |
int | BottomLeftPixel () |
The index in the atlas of the pixel in the bottom left corner of this location. More... | |
int | RowPixelDelta () |
How many pixels should be gained to go up one row of pixels in the global atlas. More... | |
int | AtlasIndex (int x, int y) |
Converts a local pixel coordinate into a global atlas pixel index. More... | |
void | Flush () |
Writes the texture to the pixels of the atlas. More... | |
void | AtlasChanged () |
Public Member Functions inherited from Blaze.UVBlock | |
UVBlock () | |
UVBlock (UVBlock copy) | |
UVBlock (float minX, float maxX, float minY, float maxY) | |
void | Write (Vector2[] buffer, int index) |
Writes out this block of UV's to the given buffer. More... | |
override string | ToString () |
Public Attributes | |
int | UsageCount |
The number of times this location is in use. More... | |
AtlasLocation | EmptyAfter |
If this location is empty (texture was removed), it's stored in a linked list. This is the element after this one in the list. More... | |
AtlasLocation | EmptyBefore |
If this location is empty (texture was removed), it's stored in a linked list. This is the element before this one in the list. More... | |
int | X |
The x coord in pixels of the left edge of the image from the left of the atlas. More... | |
int | Y |
The y coord in pixels of the bottom edge of the image from the bottom of the atlas. More... | |
int | Area |
The area of this image (width*height). More... | |
int | Width |
The width of the image in pixels. More... | |
int | Height |
The height of the image in pixels. More... | |
bool | Empty |
True if the texture in this location has been removed and it is now empty. More... | |
AtlasEntity | Image |
The image stored at this atlas location. More... | |
int | AtlasID |
The ID of the entity stored in this location. Same as Image.GetAtlasID(). More... | |
TextureAtlas | Atlas |
The atlas this location is on. More... | |
float | InvertedSizeX |
1/the atlas width. More... | |
float | InvertedSizeY |
1/the atlas height. More... | |
int | Spacing |
Active spacing on this location. More... | |
Public Attributes inherited from Blaze.UVBlock | |
float | MinX |
The min UV x coordinate. More... | |
float | MinY |
The min UV y coordinate. More... | |
float | MaxX |
The max UV x coordinate. More... | |
float | MaxY |
The max UV y coordinate. More... | |
Properties | |
override bool | Shared [get] |
True if this UV block is a globally shared one. More... | |
Properties inherited from Blaze.UVBlock | |
virtual bool | Shared [get] |
True if this UV block is a globally shared one. More... | |
Private Member Functions | |
void | BakeUV () |
Figures out where the UV's are. Note: stored as Min and Max because it's most useful for rendering and memory usage. More... | |
|
inline |
Creates a new location on the given atlas with the given size.
atlas | The atlas this location refers to. |
x | The x coordinate of the left edge of this location in pixels from the left. |
y | The y coordinate of the bototm edfe of this location in pixels from the bottom. |
width | The width of the location in pixels. |
height | The height of the location in pixels. |
|
inline |
Creates a new atlas location without an atlas.
x | The x coordinate of the left edge of this location in pixels from the left. |
y | The y coordinate of the bototm edfe of this location in pixels from the bottom. |
width | The width of the location in pixels. |
height | The height of the location in pixels. |
imageWidth | The width of the atlas. |
imageHeight | The height of the atlas. |
|
inline |
A fixed atlas location with 0->1 UV's.
|
inline |
Adds this location to the set of empty locations on the atlas. This allows other textures to use this space on the atlas.
|
inline |
|
inline |
Converts a local pixel coordinate into a global atlas pixel index.
x | The x coordinate of the pixel in pixels from the left edge. |
y | The y coordinate of the pixel in pixels from the bottom edge. |
|
inlineprivate |
Figures out where the UV's are. Note: stored as Min and Max because it's most useful for rendering and memory usage.
|
inline |
The index in the atlas of the pixel in the bottom left corner of this location.
|
inline |
Called when an instance of the image goes offscreen.
|
inline |
Empties this location and frees it up for use by other textures.
|
inline |
A value which represents how well the given image dimensions fit in this location. Select the location with this as close to zero as possible. It's essentially pixels wasted using this location.
width | The width of what you want to fit in this location. |
height | The height of what you want to fit in this location. |
area | width*height. |
|
inline |
Writes the texture to the pixels of the atlas.
|
inline |
Gets the horizontal component of the UV co-ordinate of the given pixel.
atPixel | The pixel on the atlas to use. |
|
inline |
Gets the vertical component of the UV co-ordinate of the given pixel.
atPixel | The pixel on the atlas to use. |
|
inline |
Used during the optimise process. This texture has selected this location to fit into. This adds it to the atlas.
location | The new location to write this region to. |
|
inline |
Blocks this location from ever getting deallocated from being no longer "in use".
|
inline |
How many pixels should be gained to go up one row of pixels in the global atlas.
|
inline |
This texture has selected this location to fit into. This adds it to the atlas.
texture | The texture that wants to go here. |
width | The width of the texture in pixels. |
height | The height of the texture in pixels. |
|
inline |
Updates a fixed image location.
int Blaze.AtlasLocation.Area |
The area of this image (width*height).
TextureAtlas Blaze.AtlasLocation.Atlas |
The atlas this location is on.
int Blaze.AtlasLocation.AtlasID |
The ID of the entity stored in this location. Same as Image.GetAtlasID().
bool Blaze.AtlasLocation.Empty |
True if the texture in this location has been removed and it is now empty.
AtlasLocation Blaze.AtlasLocation.EmptyAfter |
If this location is empty (texture was removed), it's stored in a linked list. This is the element after this one in the list.
AtlasLocation Blaze.AtlasLocation.EmptyBefore |
If this location is empty (texture was removed), it's stored in a linked list. This is the element before this one in the list.
int Blaze.AtlasLocation.Height |
The height of the image in pixels.
AtlasEntity Blaze.AtlasLocation.Image |
The image stored at this atlas location.
float Blaze.AtlasLocation.InvertedSizeX |
1/the atlas width.
float Blaze.AtlasLocation.InvertedSizeY |
1/the atlas height.
int Blaze.AtlasLocation.Spacing |
Active spacing on this location.
int Blaze.AtlasLocation.UsageCount |
The number of times this location is in use.
int Blaze.AtlasLocation.Width |
The width of the image in pixels.
int Blaze.AtlasLocation.X |
The x coord in pixels of the left edge of the image from the left of the atlas.
int Blaze.AtlasLocation.Y |
The y coord in pixels of the bottom edge of the image from the bottom of the atlas.
|
get |
True if this UV block is a globally shared one.