ok thanksInterkarma wrote:@interkarma:
My feeling is that Daggerfall is using normalized coordinates from building's model origin inside block. You've noticed how well player position in world lines up to building footprint on automap when the coordinates are handled correctly (great work on that by the way). I'll work on adding building coordinates to block metadata and that should be enough for a first pass.
It could be DF uses a completely different method I just haven't found yet, but the above should be perfectly workable as a starting point. If/when a better method is found, I'll hand back those coordinates instead.
my plan would have been to render each building name "plate" to a separate Texture2D and place them in the correct position. that way moving the camera and zooming in/out would work without any changes required to the plates once they are in place. when rotating it should suffice to rotate the transform of each plate.Interkarma wrote:Rendering direct into the automap texture might not be the best as zoom&rotate feature will distort text, and it will rotate with map (so text ends up at 45 degrees for example). It will also make it a lot harder to edit names on the map or place custom labels like in DF.Nystul wrote:
- a way to render text into a Texture2D (ideally a helper function in DaggerfallFont class to render to Texture2D, I will see how far I can get - might need some help there)
I think it would be better to use the DagUI features already present (like TextLabel) to render text. A little math will be needed to position text correctly on map rotation, but that isn't hard. This also allows you to take advantage of the higher pixel density of the canvas for better text quality at more zoom levels. If text fuzzes up too badly at smallest levels, we can just disable text after user zooms out far enough.
We might even be able to improve text readability a bit while keeping same look and feel (better fonts, better scaling, etc.). Something to keep in mind for later.
I'll try to get those building coordinates in for you as soon as I'm able.
Not sure if the DagUI elements behave the same way in relation to the automap camera. If so there is no reason not to use those...
edit: ok so I tested DagUI TextLabel and placement and scaling can not be changed how it seems once it is attached to the render panel of the automap.
for example trying to scale with
Code: Select all
label.AutoSize = AutoSizeModes.None;
label.Scale = new Vector2(20.0f, 20.0f);
label.Update();