asny / three-d

2D/3D renderer - makes it simple to draw stuff across platforms (including web)
MIT License
1.33k stars 110 forks source link

add simple example to render text using `fontdue` #312

Closed Nevsden closed 1 year ago

Nevsden commented 1 year ago

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 #152

Issues so far with this solution:

Nevsden commented 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.

Also, todos from @asny still ongoing.

guija commented 1 year ago

I'm interested in this change, what is the status of this? Is someone working on it? I could support if necessary.

asny commented 1 year ago

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.