Closed Nevsden closed 1 year ago
Changed the struct TextEffect
to hold a string instead of a single char. Further changed function rasterize
to turn string instead of a char into a CpuTexture
. Computation of the correct permutation from the bitmap for each char in the string to the unified TextureData::RgbaU8
brought a little confusion but I solved it.
CpuTexture
without using Sprites
.three-d::Texture2D
level, once the CpuTexture
has been consumed by the ColorMaterial::new_transparent
function.Also, todos from @asny still ongoing.
I'm interested in this change, what is the status of this? Is someone working on it? I could support if necessary.
I'm interested in this change, what is the status of this? Is someone working on it? I could support if necessary.
I think this is mostly replaced by https://github.com/asny/three-d/issues/376, so I'm closing this.
Added text rendering in the most simple way using
fontdue
to create a text bitmap on request. Also added a simple example to render text on a sprite. Related to #152text
module undercrate::renderer
. Not sure, if this is the correct level.Font
class, which reads in a ttf font usingfontdue
and can rasterize characters.TextEffect
holding information on the text and text size to be rendered.Issues so far with this solution:
Font::rasterize
, which could be expensive. An interim struct to hold all possible characters in atexture atlas
is probably the more efficient way.