Initial commit
This commit is contained in:
52
Torque/SDK/engine/gui/controls/guiBitmapCtrl.h
Normal file
52
Torque/SDK/engine/gui/controls/guiBitmapCtrl.h
Normal file
@@ -0,0 +1,52 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// Torque Game Engine
|
||||
// Copyright (C) GarageGames.com, Inc.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#ifndef _GUIBITMAPCTRL_H_
|
||||
#define _GUIBITMAPCTRL_H_
|
||||
|
||||
#ifndef _GUICONTROL_H_
|
||||
#include "gui/core/guiControl.h"
|
||||
#endif
|
||||
#ifndef _GTEXMANAGER_H_
|
||||
#include "dgl/gTexManager.h"
|
||||
#endif
|
||||
#ifndef _GUIMOUSEEVENTCTRL_H_
|
||||
#include "gui/guiMouseEventCtrl.h"
|
||||
#endif
|
||||
|
||||
/// Renders a bitmap.
|
||||
class GuiBitmapCtrl : public GuiMouseEventCtrl
|
||||
{
|
||||
private:
|
||||
typedef GuiControl Parent;
|
||||
|
||||
protected:
|
||||
StringTableEntry mBitmapName;
|
||||
TextureHandle mTextureHandle;
|
||||
Point2I startPoint;
|
||||
bool mWrap;
|
||||
|
||||
public:
|
||||
//creation methods
|
||||
DECLARE_CONOBJECT(GuiBitmapCtrl);
|
||||
GuiBitmapCtrl();
|
||||
static void initPersistFields();
|
||||
|
||||
//Parental methods
|
||||
bool onWake();
|
||||
void onSleep();
|
||||
void inspectPostApply();
|
||||
|
||||
void setBitmap(const char *name,bool resize = false);
|
||||
void setBitmap(const TextureHandle &handle,bool resize = false);
|
||||
|
||||
S32 getWidth() const { return(mTextureHandle.getWidth()); }
|
||||
S32 getHeight() const { return(mTextureHandle.getHeight()); }
|
||||
|
||||
void onRender(Point2I offset, const RectI &updateRect);
|
||||
void setValue(S32 x, S32 y);
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user