Loading...
Searching...
No Matches
IGUIButton.h
Go to the documentation of this file.
// Copyright (C) 2002-2012 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __I_GUI_BUTTON_H_INCLUDED__
#define __I_GUI_BUTTON_H_INCLUDED__
#include "IGUIElement.h"
namespace irr
{
namespace video
{
class ITexture;
} // end namespace video
namespace gui
{
class IGUIFont;
class IGUISpriteBank;
enum EGUI_BUTTON_STATE
{
EGBS_BUTTON_UP=0,
EGBS_BUTTON_DOWN,
EGBS_BUTTON_MOUSE_OVER,
EGBS_BUTTON_MOUSE_OFF,
EGBS_BUTTON_FOCUSED,
EGBS_BUTTON_NOT_FOCUSED,
EGBS_COUNT
};
const c8* const GUIButtonStateNames[] =
{
"buttonUp",
"buttonDown",
"buttonMouseOver",
"buttonMouseOff",
"buttonFocused",
"buttonNotFocused",
0,
0,
};
class IGUIButton : public IGUIElement
{
public:
IGUIButton(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle)
: IGUIElement(EGUIET_BUTTON, environment, parent, id, rectangle) {}
virtual void setOverrideFont(IGUIFont* font=0) = 0;
virtual IGUIFont* getOverrideFont(void) const = 0;
virtual IGUIFont* getActiveFont() const = 0;
virtual void setImage(video::ITexture* image=0) = 0;
virtual void setImage(video::ITexture* image, const core::rect<s32>& pos) = 0;
virtual void setPressedImage(video::ITexture* image=0) = 0;
virtual void setPressedImage(video::ITexture* image, const core::rect<s32>& pos) = 0;
virtual void setSpriteBank(IGUISpriteBank* bank=0) = 0;
virtual void setSprite(EGUI_BUTTON_STATE state, s32 index,
video::SColor color=video::SColor(255,255,255,255), bool loop=false) = 0;
virtual void setIsPushButton(bool isPushButton=true) = 0;
virtual void setPressed(bool pressed=true) = 0;
virtual bool isPressed() const = 0;
virtual void setUseAlphaChannel(bool useAlphaChannel=true) = 0;
virtual bool isAlphaChannelUsed() const = 0;
virtual bool isPushButton() const = 0;
virtual void setDrawBorder(bool border=true) = 0;
virtual bool isDrawingBorder() const = 0;
virtual void setScaleImage(bool scaleImage=true) = 0;
virtual bool isScalingImage() const = 0;
};
} // end namespace gui
} // end namespace irr
#endif
IGUIElement.h
irr::core::rect
Rectangle template.
Definition rect.h:27
irr::gui::IGUIButton::setSpriteBank
virtual void setSpriteBank(IGUISpriteBank *bank=0)=0
Sets the sprite bank used by the button.
irr::gui::IGUIButton::setPressedImage
virtual void setPressedImage(video::ITexture *image, const core::rect< s32 > &pos)=0
Sets an image which should be displayed on the button when it is in pressed state.
irr::gui::IGUIButton::setPressedImage
virtual void setPressedImage(video::ITexture *image=0)=0
Sets a background image for the button when it is in pressed state.
irr::gui::IGUIButton::setImage
virtual void setImage(video::ITexture *image, const core::rect< s32 > &pos)=0
Sets a background image for the button when it is in normal state.
irr::gui::IGUIButton::setPressed
virtual void setPressed(bool pressed=true)=0
Sets the pressed state of the button if this is a pushbutton.
irr::gui::IGUIButton::isPressed
virtual bool isPressed() const =0
Returns if the button is currently pressed.
irr::gui::IGUIButton::setSprite
virtual void setSprite(EGUI_BUTTON_STATE state, s32 index, video::SColor color=video::SColor(255, 255, 255, 255), bool loop=false)=0
Sets the animated sprite for a specific button state.
irr::gui::IGUIButton::getOverrideFont
virtual IGUIFont * getOverrideFont(void) const =0
Gets the override font (if any).
irr::gui::IGUIButton::setUseAlphaChannel
virtual void setUseAlphaChannel(bool useAlphaChannel=true)=0
Sets if the alpha channel should be used for drawing background images on the button (default is fals...
irr::gui::IGUIButton::getActiveFont
virtual IGUIFont * getActiveFont() const =0
Get the font which is used right now for drawing.
irr::gui::IGUIButton::setIsPushButton
virtual void setIsPushButton(bool isPushButton=true)=0
Sets if the button should behave like a push button.
irr::gui::IGUIButton::IGUIButton
IGUIButton(IGUIEnvironment *environment, IGUIElement *parent, s32 id, core::rect< s32 > rectangle)
constructor
Definition IGUIButton.h:63
irr::gui::IGUIButton::setDrawBorder
virtual void setDrawBorder(bool border=true)=0
Sets if the button should use the skin to draw its border and button face (default is true).
irr::gui::IGUIButton::setOverrideFont
virtual void setOverrideFont(IGUIFont *font=0)=0
Sets another skin independent font.
irr::gui::IGUIButton::isPushButton
virtual bool isPushButton() const =0
Returns whether the button is a push button.
irr::gui::IGUIButton::setScaleImage
virtual void setScaleImage(bool scaleImage=true)=0
Sets if the button should scale the button images to fit.
irr::gui::IGUIButton::setImage
virtual void setImage(video::ITexture *image=0)=0
Sets an image which should be displayed on the button when it is in normal state.
irr::gui::IGUIButton::isScalingImage
virtual bool isScalingImage() const =0
Checks whether the button scales the used images.
irr::gui::IGUIButton::isDrawingBorder
virtual bool isDrawingBorder() const =0
Returns if the border and button face are being drawn using the skin.
irr::gui::IGUIButton::isAlphaChannelUsed
virtual bool isAlphaChannelUsed() const =0
Returns if the alpha channel should be used for drawing background images on the button.
irr::gui::IGUIElement::IGUIElement
IGUIElement(EGUI_ELEMENT_TYPE type, IGUIEnvironment *environment, IGUIElement *parent, s32 id, const core::rect< s32 > &rectangle)
Constructor.
Definition IGUIElement.h:30
irr::gui::IGUIEnvironment
GUI Environment. Used as factory and manager of all other GUI elements.
Definition IGUIEnvironment.h:71
irr::gui::IGUIFont
Font interface.
Definition IGUIFont.h:40
irr::gui::IGUISpriteBank
Sprite bank interface.
Definition IGUISpriteBank.h:46
irr::video::ITexture
Interface of a Video Driver dependent Texture.
Definition ITexture.h:99
irr::video::SColor
Class representing a 32 bit ARGB color.
Definition SColor.h:202
irr::gui
The gui namespace contains useful classes for easy creation of a graphical user interface.
Definition EGUIAlignment.h:11
irr::gui::EGUI_BUTTON_STATE
EGUI_BUTTON_STATE
Definition IGUIButton.h:24
irr::gui::EGBS_BUTTON_MOUSE_OFF
@ EGBS_BUTTON_MOUSE_OFF
The mouse cursor is not over the button.
Definition IGUIButton.h:32
irr::gui::EGBS_BUTTON_DOWN
@ EGBS_BUTTON_DOWN
The button is currently pressed down.
Definition IGUIButton.h:28
irr::gui::EGBS_BUTTON_MOUSE_OVER
@ EGBS_BUTTON_MOUSE_OVER
The mouse cursor is over the button.
Definition IGUIButton.h:30
irr::gui::EGBS_BUTTON_FOCUSED
@ EGBS_BUTTON_FOCUSED
The button has the focus.
Definition IGUIButton.h:34
irr::gui::EGBS_BUTTON_NOT_FOCUSED
@ EGBS_BUTTON_NOT_FOCUSED
The button doesn't have the focus.
Definition IGUIButton.h:36
irr::gui::EGBS_BUTTON_UP
@ EGBS_BUTTON_UP
The button is not pressed.
Definition IGUIButton.h:26
irr::gui::EGBS_COUNT
@ EGBS_COUNT
not used, counts the number of enumerated items
Definition IGUIButton.h:38
irr::gui::GUIButtonStateNames
const c8 *const GUIButtonStateNames[]
Names for gui button state icons.
Definition IGUIButton.h:42
irr::gui::EGUIET_BUTTON
@ EGUIET_BUTTON
A button (IGUIButton).
Definition EGUIElementTypes.h:20
irr::video
The video namespace contains classes for accessing the video driver. All 2d and 3d rendering is done ...
Definition EDriverFeatures.h:11
irr
Everything in the Irrlicht Engine can be found in this namespace.
Definition aabbox3d.h:13
irr::c8
char c8
8 bit character variable.
Definition irrTypes.h:31
irr::s32
signed int s32
32 bit signed variable.
Definition irrTypes.h:66
- Irrlicht Engine Documentation © 2003-2012 by Nikolaus Gebhardt. Generated on for Irrlicht 3D Engine by Doxygen 1.15.0