Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static void DrawRotatedText(int x, int y, string text, float rotation)
- {
- float originX = 80, originY = 11;
- var lines = text.Split('\n');
- for (int i = 0; i < lines.Length; i++)
- {
- for (int j = 0; j < lines[i].Length; j++)
- {
- float fromOriginX = j - originX, fromOriginY = i - originY;
- float newX, newY;
- float s = (float)Math.Sin(rotation);
- float c = (float)Math.Cos(rotation);
- newX = (fromOriginX * s - fromOriginY * c);
- newY = (fromOriginX * c + fromOriginY * s);
- fastConsole.WriteChar((int)Math.Round(x + newX), (int)Math.Round(y + newY), lines[i][j], ConsoleColor.White, ConsoleColor.DarkBlue);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement