Nystul wrote:@interkarma:
I want to start implementing visualization of building names on the map.
In a first version I just want to use dummy names like armorer, weapon smith, residence etc. - this info can be derived from your bulding structs pretty easy.
No problems. Great idea, dummy names are a good place to start nailing down position and rendering of text. Once we have text handling in place, I'll port over my name generation code from test env.
Nystul wrote:
- a way to determine the center position of each building:
- either within its 64x64 map layout bitmap (its rmb block) in pixel or normalized coordinates
- or in normalized coordinates in the current map pixel for the loaded location either in reference to the layout width/height
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.
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)
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.
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.