25 #include <guichan.hpp>
57 const gcn::ClipRectangle& clip = graphics->getCurrentClipArea();
59 rect.
x = x + clip.xOffset;
60 rect.
y = y + clip.yOffset + yoffset;
64 if (!rect.
intersects(
Rect(clip.x,clip.y,clip.width,clip.height)) ) {
79 const gcn::ClipRectangle& clip = graphics->getCurrentClipArea();
84 rect.
x = x + clip.xOffset;
85 rect.
y = y + clip.yOffset + yoffset;
88 if (!rect.
intersects(
Rect(clip.x,clip.y,clip.width,clip.height)) ) {
int32_t getWidth(const std::string &text) const
gets width of given text
std::string splitTextToWidth(const std::string &text, int32_t render_width)
SDL_Color getColor() const
Get the color the text was rendered in.
void drawMultiLineString(gcn::Graphics *graphics, const std::string &text, int32_t x, int32_t y)
T h
Height of the rectangle.
virtual bool isAntiAlias()=0
Checks if anti aliasing is used.
GuiFont(IFont *font)
Constructor Takes the ownership of given font.
Image * getAsImage(const std::string &text)
Gets given text as Image The rsulting image is pooled, so it's not that time critical.
virtual Image * getAsImage(const std::string &text)=0
Gets given text as Image The rsulting image is pooled, so it's not that time critical.
virtual Image * getAsImageMultiline(const std::string &text)=0
Gets given text as Image.
virtual void setColor(uint8_t r, uint8_t g, uint8_t b, uint8_t a=255)=0
Set the color the text should be rendered in.
virtual std::string splitTextToWidth(const std::string &text, int32_t render_width)=0
virtual int32_t getRowSpacing() const =0
Gets the spacing between rows in pixels.
virtual void invalidate()=0
int32_t getStringIndexAt(const std::string &text, int32_t x) const
virtual SDL_Color getColor() const =0
Get the color the text was rendered in.
void setRowSpacing(int32_t spacing)
Sets the spacing between rows in pixels.
void drawString(gcn::Graphics *graphics, const std::string &text, int32_t x, int32_t y)
Image * getAsImageMultiline(const std::string &text)
Gets given text as Image.
uint32_t getHeight() const
virtual int32_t getStringIndexAt(const std::string &text, int32_t x) const =0
void setGlyphSpacing(int32_t spacing)
Sets the spacing between letters in pixels.
virtual int32_t getHeight() const =0
gets height of this font
virtual void setGlyphSpacing(int32_t spacing)=0
Sets the spacing between letters in pixels.
int32_t getHeight() const
gets height of this font
uint32_t getWidth() const
virtual int32_t getGlyphSpacing() const =0
Gets the spacing between letters in pixels.
bool intersects(const RectType< T > &rect) const
Check whether two rectangles share some area.
Pure abstract Font interface.
virtual void render(const Rect &rect, uint8_t alpha=255, uint8_t const *rgb=0)=0
Renders itself to the current render target (main screen or attached destination image) at the rectan...
void setAntiAlias(bool antiAlias)
Sets the use of anti aliasing.
virtual void setRowSpacing(int32_t spacing)=0
Sets the spacing between rows in pixels.
int32_t getGlyphSpacing() const
Gets the spacing between letters in pixels.
bool isAntiAlias()
Checks if anti aliasing is used.
virtual int32_t getWidth(const std::string &text) const =0
gets width of given text
virtual void setAntiAlias(bool antiAlias)=0
Sets the use of anti aliasing.
T w
Width of the rectangle.
void setColor(uint8_t r, uint8_t g, uint8_t b, uint8_t a=255)
Set the color the text should be rendered in.
int32_t getRowSpacing() const
Gets the spacing between rows in pixels.