Bithack / principia

Open source physics-based sandbox game.
https://principia-web.se
Other
258 stars 25 forks source link

(re-opened from the new repo) Improve sticky note text rendering #120

Closed griffi-gh closed 1 year ago

griffi-gh commented 1 year ago

now lives here: #126

Shoves (up to) 64 notes into a single 1024x1024/2048x2048 texture!

Everything is configurable! (Note width, height, font scale, texture width/height, slot count, non-square textures should be supported)

should be good enough (tm) to merge, but please test thoroughly.

This also adds a new "Sticky note resolution" option (which is enabled by default on PC, and disabled on Android)

This is not a complete rewrite, and it still does some weird things under the hood...

Btw, I disabled layer switching I added in the #107, mostly just for testing, but it didn't work wery well anyway. :p
basically just a visual change.

griffi-gh commented 1 year ago

Got to "usable" stage:

My sticky implementation: principia_xxIwYsjCVL

Latest beta:

principia_RtxYwxE5ol

There are still some major issues though

griffi-gh commented 1 year ago

principia_wN2QVrfkV3

decided to 2x the resolution on pc (and keep the same resolution on mobile...)

griffi-gh commented 1 year ago

Before:

Screenshot_20230603_121427_Principia

After:

principia_ESF9Lh2nnL

this is a huge improvement.

griffi-gh commented 1 year ago

I'll add a setting for it (if possible) later.
it would require a restart though

rollerozxa commented 1 year ago

Is there any reason the sticky note resolution can't just be the higher resolution without a setting?

griffi-gh commented 1 year ago

Is there any reason the sticky note resolution can't just be the higher resolution without a setting?

because it significantly slows down level loading (takes like a second or two to render fonts) if there are a lot of notes on low-end devices?
also, compatability. normally principia doesn't use textures larger than 1024x1024 and this goes above that.
maybe impacts some older android 2/3/4 devices?

didn't feel comfortable just keeping it enabled

griffi-gh commented 1 year ago

probably should be merged into a single "Texture resolution" setting...
separate option just for sticky notes is a bit weird

wait we already have that right? android only though?