tibia-client/src/client/animatedtext.h

64 lines
2.1 KiB
C
Raw Normal View History

2011-12-26 12:53:16 +01:00
/*
* Copyright (c) 2010-2013 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
2012-06-22 05:14:13 +02:00
// @bindclass
class AnimatedText : public Thing
2011-12-26 12:53:16 +01:00
{
public:
AnimatedText();
2012-06-17 23:47:05 +02:00
void drawText(const Point& dest, const Rect& visibleRect);
2011-12-26 12:53:16 +01:00
void setColor(int color);
void setText(const std::string& text);
void setOffset(const Point& offset) { m_offset = offset; }
Color getColor() { return m_color; }
const CachedText& getCachedText() const { return m_cachedText; }
Point getOffset() { return m_offset; }
Timer getTimer() { return m_animationTimer; }
bool merge(const AnimatedTextPtr& other);
2011-12-26 12:53:16 +01:00
AnimatedTextPtr asAnimatedText() { return static_self_cast<AnimatedText>(); }
2012-06-05 17:36:27 +02:00
bool isAnimatedText() { return true; }
2011-12-26 12:53:16 +01:00
protected:
virtual void onAppear();
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;
Point m_offset;
2011-12-26 12:53:16 +01:00
};
#endif