Files
eepp/include/eepp/graphics/drawable.hpp
Martín Lucas Golini 45cf7f4f73 UINodeDrawable replacing UISkinState for UINode background and foreground.
WIP new properties support.
Added "text-align" property to UITextView.
Fixed a bug in StyleSheetSelectorRule.

--HG--
branch : dev
2019-11-13 17:40:38 -03:00

89 lines
1.5 KiB
C++

#ifndef EE_GRAPHICS_DRAWABLE_HPP
#define EE_GRAPHICS_DRAWABLE_HPP
#include <eepp/math/size.hpp>
#include <eepp/system/color.hpp>
#include <eepp/graphics/blendmode.hpp>
#include <eepp/graphics/rendermode.hpp>
using namespace EE::Math;
using namespace EE::System;
namespace EE { namespace Graphics {
class StatefulDrawable;
class EE_API Drawable {
public:
enum Type {
TEXTURE,
TEXTUREREGION,
SPRITE,
ARC,
RECTANGLE,
CONVEXSHAPE,
GROUP,
NINEPATCH,
STATELIST,
SKIN,
UINODEDRAWABLE,
UINODEDRAWABLE_LAYERDRAWABLE,
CUSTOM
};
virtual ~Drawable();
virtual Sizef getSize() = 0;
virtual void draw() = 0;
virtual void draw( const Vector2f& position ) = 0;
virtual void draw( const Vector2f& position, const Sizef& size ) = 0;
virtual bool isStateful() = 0;
void setAlpha( Uint8 alpha );
const Uint8& getAlpha();
void setColor( const Color& color );
Color getColor() const;
void setColorFilter( const Color& color );
RGB getColorFilter();
void clearColor();
void clearColorFilter();
void resetAlpha();
Type getDrawableType() const;
const Vector2f& getPosition() const;
void setPosition( const Vector2f& position );
StatefulDrawable * asStatefulDrawable();
virtual bool isDrawableResource() const;
protected:
Type mDrawableType;
Color mColor;
Vector2f mPosition;
Drawable( Type drawableType );
virtual void onAlphaChange();
virtual void onColorFilterChange();
virtual void onPositionChange();
};
}}
#endif