

We would normally always apply a WorldTransformation matrix to the vertices so they're moved into the correct positions for proper viewing (this is already done in the default vertex shader for spriteBatch and the one we made for QuadEffect.fx for quadBatch). Could also be useful in making wobbly effects or other interesting distortions. This can be useful if you wanted to over-ride the regular vertex shader to make one that provides swaying or waving motions to the vertices in the scene (like a tree made of multiple vertices that you want to sway). Vertex shaders make changes to the vertices of the primitives to be rendered. But i'm happy to discuss/share what I have if you do proceed down that path.Introduction to Shaders (skip ahead a bit if already familiar): I have some classes I have written to enable the above mentioned functionality, they are a little embedded in my game. Others you might want to consider is things like centring text. You have all the data, so you can create your overlay functions such as width. Overlay your glyph string functionality over the top.Stuff like colour, size, font type, alpha etc, fit perfectly (and fit Do not build all the functionality into the glyph object.Every glyph is an object, work out what attributes you need.If you choose the coding route, then you do have flexibility. Weigh up the compromises on libraries or if you were ever using something like Unity, plugins for example.

It will save you so much time if you can just sit down and define all the things you would need, then want and what would be a nice to have.

I am using spriteFont.MeasureString() to allow me to draw the letters in the correct positions relative to each other, but it hasn't been giving me the values I need. So far, I've had no luck finding a way to do this.Īt the moment, I've been attempting to remake the TextBox class to print each character with its own draw call, allowing me to change a letter's colour - and therefore alpha - individually. However, this method has some significant limitations - inability to change the font or colour of individual lines, for example - but there is something specific I am trying to achieve: I want each new letter to fade gradually onto the screen instead of just appearing instantly. It does this by storing received text in a buffer string, and using Update() to periodically push letters into the output string, which is then drawn to the screen (I've written a function for wrapping, so I've had no problem there). I have created a TextBox class which prints text onto the screen one letter at a time (like it's being typed). I'm making a text adventure-style game with MonoGame.
