• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • If you're using Gesior 2012 or MyAAC, please review this thread for information about a serious security vulnerability and a fix.

Trying to do a World2Screen function

kuhi

Active Member
Joined
Aug 26, 2012
Messages
147
Solutions
1
Reaction score
37
Location
kuhi#6402
GitHub
Kuhicop
Hello, anyone knows how OtClient converts WndProc XY to the client XYZ coordinates?

I'm trying to make a function to convert XYZ from tibia to XY to screen coordinates (World2Screen).

For now, the way I know to achieve it would be by finding the viewmatrix and angles like any ESP. Or also I've found the function transformPositionTo2D in mapview.cpp

I'm not sure how to proceed and maybe there's someone with experience in this subject that could throw some light :)
 

oen432

Legendary OT User
Joined
Oct 3, 2014
Messages
1,569
Solutions
52
Reaction score
1,689
Location
Poland
GitHub
Oen44
What exactly are you trying to achieve? Looks like you are overthinking this. What angles? There are no angles in Tibia. This is 2D rendering, not 3D, There is no Z position either.
 
OP
OP
kuhi

kuhi

Active Member
Joined
Aug 26, 2012
Messages
147
Solutions
1
Reaction score
37
Location
kuhi#6402
GitHub
Kuhicop
What exactly are you trying to achieve? Looks like you are overthinking this. What angles? There are no angles in Tibia. This is 2D rendering, not 3D, There is no Z position either.
For example, you have brown mushrooms in arrow slot, how to know it's screen coordinates?
 

mrianura

Active Member
Joined
Jan 31, 2015
Messages
43
Reaction score
34
You have widgets system, with root on very bottom, You know root size, oords etc, root has children with position, which can be relative to parent. You have go through widget tree and find final position. Brown mushrooms in arrow slot is in fact UIItem located somewhere in the widget tree.
 

River KA

Veteran OT User
Joined
Feb 1, 2010
Messages
507
Solutions
26
Reaction score
307
UIWidget::getPosition()

E.g., brownMushroomsItemWidget:getPosition()
 
OP
OP
kuhi

kuhi

Active Member
Joined
Aug 26, 2012
Messages
147
Solutions
1
Reaction score
37
Location
kuhi#6402
GitHub
Kuhicop
Do you want to read it from Lua, C++ or from BOT (other application)?
from my bot GitHub - Kuhicop/Tibia-OpenGL-Imgui: Learning to make a Tibia bot (https://github.com/Kuhicop/Tibia-OpenGL-Imgui)
Gesior you are a legend <3
Post automatically merged:

UIWidget::getPosition()

E.g., brownMushroomsItemWidget:getPosition()
ok I think I got the getPosition() function I will play a bit with widgets to see what I can get :)
1655821034587.png
Thank you <3
 
Last edited:
Top