| 4066 | } |
| 4067 | |
| 4068 | void PixelGameEngine::DrawRotatedStringPropDecal(const olc::vf2d& pos, const std::string& sText, const float fAngle, const olc::vf2d& center, const Pixel col, const olc::vf2d& scale) |
| 4069 | { |
| 4070 | olc::vf2d spos = center; |
| 4071 | for (auto c : sText) |
| 4072 | { |
| 4073 | if (c == '\n') |
| 4074 | { |
| 4075 | spos.x = center.x; spos.y -= 8.0f; |
| 4076 | } |
| 4077 | else if (c == '\t') |
| 4078 | { |
| 4079 | spos.x += 8.0f * float(nTabSizeInSpaces) * scale.x; |
| 4080 | } |
| 4081 | else |
| 4082 | { |
| 4083 | int32_t ox = (c - 32) % 16; |
| 4084 | int32_t oy = (c - 32) / 16; |
| 4085 | DrawPartialRotatedDecal(pos, fontRenderable.Decal(), fAngle, spos, { float(ox) * 8.0f + float(vFontSpacing[c - 32].x), float(oy) * 8.0f }, { float(vFontSpacing[c - 32].y), 8.0f }, scale, col); |
| 4086 | spos.x -= float(vFontSpacing[c - 32].y); |
| 4087 | } |
| 4088 | } |
| 4089 | } |
| 4090 | |
| 4091 | olc::vi2d PixelGameEngine::GetTextSize(const std::string& s) |
| 4092 | { |