class
SpriteGlyph
Implementation of SpriteImage that renders a single glyph from a Font.
Public
Methods
FindOrAllocateImageToFitArea
Attempts to allocate a new image that is of appropriate quality to fit into the provided area.
This is mostly used by vector shapes, which will usually want to re-render themselves to fit the requested size and achieve the best possible quality.
The image will be scaled uniformly until one or both dimensions of the image match the provided size. One dimension may be smaller than the provided size.
Implementations may choose to avoid re-rendering and just return the default allocated image instead, in which case its up to the caller to scale the image appropriately (e.g. using bilinear filtering or scale9grid).
If an existing allocation for the provided size already exists, it will be returned and a new allocation will not be made alive. Allocated portion of the texture will remain alive as long as there is at least a single reference to the returned SpriteImageAllocation.
- size
- Requested size of the allocation, in physical pixel units.
Returns: Allocation structure that provides information about the allocation and used for tracking allocation lifetime.
FindOrAllocateScaledImage
Attempts to allocate a new image that is of appropriate quality for a scaled version of the default image.
This is mostly used by vector shapes, which will usually want to re-render themselves to fit the requested scale and achieve the best possible quality (e.g. scale may change when display DPI changes, or when user zooms in/out).
Implementations may choose to avoid re-rendering and just return the default allocated image instead, in which case its up to the caller to scale the image appropriately (e.g. using bilinear filtering or scale9grid).
If an existing allocation for the provided size already exists, it will be returned and a new allocation will not be made alive. Allocated portion of the texture will remain alive as long as there is at least a single reference to the returned SpriteImageAllocation.
- scale
- Scale to apply.
Returns: Allocation structure that provides information about the allocation and used for tracking allocation lifetime.
staticCreate
Creates a new sprite glyph.
staticCreate
Creates a new sprite glyph.
staticGetRttiStatic
Private
Constructors
SpriteGlyph
Methods
AllocateImage
Allocates a sprite image using the provided size in points.
Initialize
Initializes all the internal data of this object.
Must be called right after construction for new objects, or after deserialization for deserialized objects. If requested, render proxy is created and queued for initialization on the render thread.
CreateRenderProxy
Creates an object that contains render thread specific data and methods for this object.
Can be null if such object is not required.
CreateRenderProxySyncPacket
Creates a data packet that will be used for syncing the core object with it's render proxy.
Caller must free the retrieved packet using the provided allocator when done using it.
staticCreateEmpty
Creates a new empty and uninitialized sprite glyph.