I sort of asked this before but maybe not so clearly
Is their a place to request official overloads be added to mono-game i.e. a wish list
and or
If i were to create a overload would i be able to add it officially to mono-game ,
(Still never used svn i guess i really should try it out , Anyways im running of the official installer.)
After looking at the source, id like to make some extra overloads
or request them.
I feel they should be a part of mono-game not separate.
but if its futile to do so id rather know before i start.
Here is a little breakdown on what i was thinking of and later down why
i realized it should be in there.
These 3 things which i feel belong in mono-game as a part of it.
A overload that takes a starting and ending character position for the DrawString method specifically the one that takes a StringBuilder
GetMaxFontCharacterLineHeight ( with a scaling parameter as well)
Couple overloads for MeasureString that allows you to pass a scaling factor and or specify a part of a stringbuilder to measure. This should be there because when scaling text, you cannot measure properly scaled text you will be drawing with this call.
At least without basically re-doing everything it just did yourself.
Even the basic recalculation of the pixel width height from a scaling requires a few steps. That is very hard for a new person to figure out.
It really should be part of the inner workings of mono-game in a simple get method call
Ultimately or rather ideally,
spritebatch.DrawString should simply take a rectangle as well as maybe a starting character , that can be drawn to instead of just a vector2.
Were the width height can delimit the amount of text drawn into rectangular area.
Though there are a lot more considerations to this and maybe too many
too ask for.
So i would state the reasons for just the above as they only are algorithmic changes and or extra overloads, methods.
I was actually working on something to wrap stringbuilder without garbage for a generic button-manager that would use that.
but…
These little missing parts 1 to 3 are really annoying.
I can see were it would be useful at anytime for display
of text even when doing simple things
Most of these things could probably be implemented as extension methods but I agree that it would be nice to extend MonoGame beyond XNA as long as they are not breaking changes.
This is great idea, particularly because it would allow people to write wrapping text components that don’t generate garbage each time the string or scaling is changed. Also not something that could be efficiently accomplished with extension methods… or is it? I just had a thought: you could have a static StringBuilder that is cleared and filled with the required substring and then passed to the default MeasureString function. I don’t think this would generate garbage.
In my experience you can just multiply the return value from MeasureString by the same scaling factor that you pass to the DrawString function.
well i posted this up on issues at github i still like the first one
maybe 2 and 3 are i suppose are trivial
as for extensions maybe this is just my ignorance showing thru
im not too down with extensions but maybe i should look into it a bit more
i was under the impression they were about the same as wrapping
pre-existing public class methods and members
i thought you couldn’t access the private and protected members and methods from them ?