Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom HUD font #95

Open
khanghugo opened this issue Mar 4, 2024 · 3 comments
Open

Custom HUD font #95

khanghugo opened this issue Mar 4, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@khanghugo
Copy link
Contributor

Speed o' meter can look a bit better I think. Sprite font seems very crude to me now.

I see we can do this the easy way or the hard way. The easy way is using VGUI2_DrawString or anything related but I have yet to find a way to increase font size. The hard way is to have custom OpenGL/Vulkan renderer for the font.

I am not sure if this is more of BunnymodXT or bxt-rs project but for the sake of recording and stuffs I think bxt-rs suits just fine.

@SmileyAG
Copy link
Contributor

SmileyAG commented Mar 4, 2024

Duplicate of YaLTeR/BunnymodXT#375

In fact, I also first thought about using a graphics library like ImGUI and executing the code before the game swap buffers

But using VGUI shouldn't be much difficult either way and in the end this may turn out to be a more convenient solution than adding another dependency to the project
In vgui.dll most of the functions are exportable, and therefore you don’t even need to predict the version of VGUI interfaces per different engine and include a bunch of VGUI headers to get access to some stuff
So I think generally there not need much for implement than a couple of function hooks by using exported symbols and few hardcoded offsets to some data members of classes

VGUI Drawing code should be executed in PaintTraverse function from VGUI module

I personally would prefer this kind of work was done on BunnymodXT end rather than bxt-rs

@khanghugo
Copy link
Contributor Author

From a little bit of digging. It seems like loading font is all done inside vgui2.dll. So we need to hook into that and see.

Here is default engine font but it is big within 1024x768.

The drop shadow looks awful but I have yet to find if there's outline option instead.

yes_aa

@khanghugo
Copy link
Contributor Author

I find it is very tricky to use VGUI2 to load any font at will. Maybe using the game's renderer to render font is easier overall.

@YaLTeR YaLTeR added the enhancement New feature or request label Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants