• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

C++ Text editing

Ascuas Funkeln

Rakkedo Game
Joined
Apr 14, 2013
Messages
549
Solutions
33
Reaction score
309
Location
Poland
GitHub
AscuasFunkeln
TSF 0.3.6 V8

Hello,

C++:
void Game::addAnimatedText(const Position& pos, uint8_t textColor,
    const std::string& text)
{
    const SpectatorVec& list = getSpectators(pos);
    addAnimatedText(list, pos, textColor, text);
}

void Game::addAnimatedText(const SpectatorVec& list, const Position& pos, uint8_t textColor,
    const std::string& text)
{
    Player* player = NULL;
    for(SpectatorVec::const_iterator it = list.begin(); it != list.end(); ++it)
    {
        if((player = (*it)->getPlayer()))
            player->sendAnimatedText(pos, textColor, text);
    }
}

Anyone have idea how to change source to make animated text "static".
I think this will be the easiest and fastest way to make onLook item colored every single word in different colors...
Already i made script thats colour every word in different color, but to finish i need to make this animated text freeze xD

Any help, suggestions, ideas? :D
 
I already using OTClient

Look how work my script on look item. But as u know this text move :D
6b1806711db3f4be0c202b13bd5f4fe9.jpeg
 
animated text in otclient source, probably there i should make changes to make it static
C++:
void AnimatedText::drawText(const Point& dest, const Rect& visibleRect)
{
    static float tf = Otc::ANIMATED_TEXT_DURATION;
    static float tftf = Otc::ANIMATED_TEXT_DURATION * Otc::ANIMATED_TEXT_DURATION;
    Point p = dest;
    Size textSize = m_cachedText.getTextSize();
    float t = m_animationTimer.ticksElapsed();
    p.x += (24 - textSize.width() / 2);
    if(g_game.getFeature(Otc::GameDiagonalAnimatedText)) {
        p.x -= (4 * t / tf) + (8 * t * t / tftf);
    }
    p.y += 8 + (-48 * t) / tf;
    p += m_offset;
    Rect rect(p, textSize);

Copy and paste "DrawText" from static text to animated text maybe will solve it? :D
I will do that and compile tomorrow, now i go sleep... We will see :p

@edit Ok, i made it :D
 
Last edited:
it's not possible without otclient or your own client
the animation is done through the client, not the engine
the engine just simply sends the text and color to display
But if I do use 7.72 that supports animated text how should I enable in server to catch server messages displayed with colors like in older tfs?
 
Back
Top