Вопрос How can i display the entity name and the position above the hero health bar ?

Начинающий
Начинающий
Статус
Оффлайн
Регистрация
11 Фев 2023
Сообщения
120
Реакции
3
i have everything needed positions , name , imgui , world2screen how can i display the entity name and the position above the healthbar ?
image.png
 
Последнее редактирование:
i have everything needed positions , name , imgui , world2screen how can i display the entity name and the position above the healthbar ?Посмотреть вложение 313447
just... get entity pos, add m_iHealthBarOffset(in 3d, to entity pos, it's a height(Z axis) offset), transform to 2d(don't forget to check if it's on the screen, not behind camera, etc., i.e. that the point is actually visible - I mean you can't see the entire map on your screen, some regions are outside of your screen, and you don't want to waste fps drawing there since you won't see it anyway), add some offset in pixels depending on where you'd like to see it(lower/higher etc.), and then render text on the screen in that location???
 
icouldnt get it to work , should i use RenderGameSystem ?
 
very descriptive
should i use RenderGameSystem ?
for the matrix - yes
but be aware that the virtual function index from the post is outdated you'll have to find it yourself. or just make a signature for the viewprojection matrix(there are xrefs to it and to its rva), or use ready-made wrappers by valve from PanoramaScript if you can find them(WorldToScreenX + WorldToScreenY they use the wrapper internally).
FYI matrices look like this in general(keep in mind they may be/appear transposed + axis configuration is different between games - there's no general agreement as to what X, Y and Z mean - for some Z is depth, for some Z is height, for some it's width, same goes for X and Y):
1755349521142.png
 
Назад
Сверху Снизу