tibia-client/src/otclient/core/animatedtext.h

52 lines
1.8 KiB
C
Raw Normal View History

2011-12-26 12:53:16 +01:00
/*
2012-01-02 17:58:37 +01:00
* Copyright (c) 2010-2012 OTClient <https://github.com/edubart/otclient>
2011-12-26 12:53:16 +01:00
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#ifndef ANIMATEDTEXT_H
#define ANIMATEDTEXT_H
#include "thing.h"
#include <framework/graphics/fontmanager.h>
2012-01-30 01:00:12 +01:00
#include <framework/core/timer.h>
#include <framework/graphics/cachedtext.h>
2011-12-26 12:53:16 +01:00
class AnimatedText : public Thing
{
public:
AnimatedText();
2012-06-17 23:47:05 +02:00
void drawText(const Point& dest, const Rect& visibleRect);
2012-01-30 01:00:12 +01:00
void startAnimation();
2011-12-26 12:53:16 +01:00
void setColor(int color);
void setText(const std::string& text);
AnimatedTextPtr asAnimatedText() { return std::static_pointer_cast<AnimatedText>(shared_from_this()); }
2012-06-05 17:36:27 +02:00
bool isAnimatedText() { return true; }
2011-12-26 12:53:16 +01:00
private:
Color m_color;
2012-01-30 01:00:12 +01:00
Timer m_animationTimer;
CachedText m_cachedText;
2011-12-26 12:53:16 +01:00
};
#endif