📄 objectcom.h
字号:
//返回字串宽度
virtual float __cdecl GetStringWidth()=NULL;
//返回字体高度
virtual float __cdecl GetHeight()=NULL;
//返回行间距
virtual float __cdecl GetSpacing()=NULL;
//返回对齐
virtual int __cdecl GetAlign()=NULL;
//返回字体大小
virtual int __cdecl GetFontSize()=NULL;
};
#define VER_IGameObjectSprite INTERFACE_VERSION(1,1)
static const GUID IID_IGameObjectSprite={0xbd02b27d,0x7274,0x46a5,0x82,0x7b,0xc4,0x49,0x83,0xfe,0x8b,0xB6};
//精灵对象接口
interface IGameObjectSprite : public IUnknownEx
{
public:
//设置镜像
virtual void __cdecl SetFlip(bool bX, bool bY)=NULL;
//设置纹理大小
virtual void __cdecl SetTextureSize(_RECT rcRect)=NULL;
//返回纹理大小
virtual _RECT __cdecl GetTextureSize()=NULL;
//设置颜色
virtual void __cdecl SetColor(DWORD dwColor)=NULL;
//返回颜色
virtual DWORD __cdecl GetColor()=NULL;
//设置绑定模式
virtual void __cdecl SetBlendMode(WORD wMode)=NULL;
//返回绑定模式
virtual WORD __cdecl GetBlendMode()=NULL;
};
#define VER_IGameObjectAnim INTERFACE_VERSION(1,1)
static const GUID IID_IGameObjectAnim = {0xeff2dd32, 0x7cc9, 0x47e9, 0xa7, 0x4b, 0xcd, 0xd6, 0x32, 0x7e, 0x29, 0x68};
//动画对象接口
interface IGameObjectAnim : public IUnknownEx
{
//设置纹理
virtual void __cdecl SetTexture(HTEXTURE hTexture)=NULL;
//返回纹理
virtual HTEXTURE __cdecl GetTexture()=NULL;
//设置动画总帧数
virtual void __cdecl SetFrames(DWORD dwFrames)=NULL;
//返回动画总帧数
virtual DWORD __cdecl GetFrames()=NULL;
//返回当前播放的行
virtual WORD __cdecl GetRow()=NULL;
//设置播放的行
virtual void __cdecl SetRow(WORD wRow)=NULL;
//设置播放到第n帧
virtual void __cdecl SetFrame(DWORD dwFrame)=NULL;
//返回当前动画播放的第n帧
virtual DWORD __cdecl GetFrame()=NULL;
//设置播放速度
virtual void __cdecl SetSpeed(float fFps)=NULL;
//返回当前动画播放速度
virtual float __cdecl GetSpeed()=NULL;
//设置播放模式
virtual void __cdecl SetMode(DWORD dwType)=NULL;
//返回播放模式
virtual DWORD __cdecl GetMode()=NULL;
//判断动画是否在播放
virtual bool __cdecl IsPlaying()=NULL;
//更改动画纹理
virtual void __cdecl SetType(DWORD dwType,DWORD dwFrames,float fFps,bool bIsRow=true)=NULL;
//播放动画
virtual void __cdecl Play()=NULL;
//转至下一帧
virtual void __cdecl NextFrame()=NULL;
//停止播放
virtual void __cdecl Stop()=NULL;
};
#define VER_IGameObjectButton INTERFACE_VERSION(1,1)
static const GUID IID_IGameObjectButton={0xbd02b27d,0x7274,0x46a5,0x82,0x7b,0xc4,0x49,0x83,0xfe,0x8b,0xB8};
//精灵对象接口
interface IGameObjectButton : public IUnknownEx
{
public:
//设置标题
virtual void __cdecl SetCaption(LPCTSTR lpCaption, int nAlign=Align_Left|Align_Top)=NULL;
//返回标题
virtual LPCTSTR __cdecl GetCaption()=NULL;
//设置标题对齐
virtual void __cdecl SetCaptionAlign(int nAlign)=NULL;
//返回标题对齐方式
virtual WORD __cdecl GetCaptionAlign()=NULL;
//返回标题对象
virtual IGameObjectText* GetCaptionObject()=NULL;
//返回图片对象
virtual IGameObjectSprite* GetSpriteObject()=NULL;
};
#define VER_IGameObjectGraph INTERFACE_VERSION(1,1)
static const GUID IID_IGameObjectGraph={ 0x8bc021ec, 0xf75f, 0x49ff,0x9a, 0xe0, 0x43, 0x78, 0x9d, 0x28, 0xe3, 0xde};
interface IGameObjectGraph : public IUnknownEx
{
public:
/**
* 对象创建
*/
virtual bool __cdecl Create(LPCTSTR lpName, _SIZE siSize, CResource* pResource, enGraphType enGraphType = Graph_Square, enGraphLine enGraphLine = Line_Normal, WORD wBorderWidth = 1, DWORD dwBackGroundColor = 0, DWORD dwBorderColor = 0xFFFFFFFF)=NULL;
/**
* 对象创建(三角形)
*/
virtual bool __cdecl Create(LPCTSTR lpName, _SIZE siSize, CResource* pResource, _POINT piPoint1, _POINT piPoint2, _POINT piPoint3)=NULL;
/**
* 对象创建(线形)
*/
virtual bool __cdecl Create(LPCTSTR lpName, _SIZE siSize, CResource* pResource, _POINT piPoint1, _POINT piPoint2)=NULL;
/**
* 对象创建(圆形)
*/
virtual bool __cdecl Create(LPCTSTR lpName, _SIZE siSize, CResource* pResource, float fRadii1, float fRadii2)=NULL;
/**
* 重绘纹理
*/
virtual void __cdecl ReDraw()=NULL;
/**
* 设置背景颜色
*/
virtual void __cdecl SetBackGroundColor(DWORD dwColor)=NULL;
/**
* 设置边框颜色
*/
virtual void __cdecl SetBorderColor(DWORD dwColor)=NULL;
/**
* 设置边框宽度
*/
virtual void __cdecl SetBorderWidth(WORD wWidth)=NULL;
/**
* 设置圆形的参数
*/
virtual void __cdecl SetCircular(float fRadii1, float fRadii2)=NULL;
/**
* 设置图形类型
*/
virtual void __cdecl SetGraphType(enGraphType enGraphType)=NULL;
/**
* 设置线的类型
*/
virtual void __cdecl SetLineType(enGraphLine enGraphLine)=NULL;
/**
* 设置三角形参数
*/
virtual void __cdecl SetTriangle(_POINT piSide1, _POINT piSide2, _POINT piSide3)=NULL;
/**
* 设置混和模式
*/
virtual void __cdecl SetBlendMode(int nBlendMode)=NULL;
/**
* 设置背景纹理
*/
virtual void __cdecl SetBackGround(CResource* pResource)=NULL;
/**
* 调整各顶点
*/
virtual void __cdecl AdjustPoints(_LPPOINT pPoints, WORD wLen)=NULL;
/**
* 调整大小(有别于SetSize的缩放)
*/
virtual void __cdecl AdjustPoints(_SIZE siSize)=NULL;
/**
* 返回背景颜色
*/
virtual DWORD __cdecl GetBackGroundColor()=NULL;
/**
* 返回边框颜色
*/
virtual DWORD __cdecl GetBorderColor()=NULL;
/**
* 返回边框宽度
*/
virtual WORD __cdecl GetBorderWidth()=NULL;
/**
* 返回图形类型
*/
virtual enGraphType __cdecl GetGraphType()=NULL;
/**
* 返回线的类型
*/
virtual enGraphLine __cdecl GetLineType()=NULL;
/**
* 返回背景纹理
*/
virtual CResource* __cdecl GetBackGround()=NULL;
};
#define VER_IGameObjectParticle INTERFACE_VERSION(1,1)
static const GUID IID_IGameObjectParticle={ 0xc2b89926, 0xf731, 0x4fbf, 0xb1, 0x18, 0x59, 0x7f, 0x19, 0x12, 0xaf, 0xe};
//粒子对象接口
interface IGameObjectParticle : public IUnknownEx
{
//粒子开始在指定点
virtual void __cdecl FireAt(_POINT poFirePoint) = NULL;
//粒子开始
virtual void __cdecl Fire()=NULL;
//停止粒子
virtual void __cdecl Stop()=NULL;
//返回粒子生命
virtual int __cdecl GetAge()=NULL;
//返回粒子生还数目
virtual int __cdecl GetParticlesAlive()=NULL;
//返回粒子属性指针
virtual hgeParticleSystemInfo* __cdecl GetParticleInfo()=NULL;
};
#define VER_IGameObjectEdit INTERFACE_VERSION(1,1)
static const GUID IID_IGameObjectEdit={ 0xc2b89926, 0xf731, 0x4fbf, 0xb1, 0x18, 0x59, 0x7f, 0x19, 0x12, 0xaf, 0xe1};
interface IGameObjectEdit : public IUnknownEx
{
//接受输入回车键
virtual void __cdecl AcceptEnterKey(bool bFlag) = NULL;
//接受TAB键
virtual void __cdecl AcceptTabKey(bool bFlag) = NULL;
//清空输入内容
virtual void __cdecl Clear() = NULL;
//返回背景纹理对象
virtual IGameObjectGraph* __cdecl GetBGObject() = NULL;
//返回文本内容对象
virtual IGameObjectText* __cdecl GetTextObject() = NULL;
//返回录入字符范围
virtual enEditCharScope __cdecl GetCharScope() = NULL;
//返回当前光标位置
virtual WORD __cdecl GetCurPosition() = NULL;
//返回录入内容
virtual LPCTSTR __cdecl GetText() = NULL;
//返回录入内容的长度
virtual WORD __cdecl GetTextLength() = NULL;
//是否接受回车键
virtual bool __cdecl IsAcceptEnterKey() = NULL;
//是否接受TAB键
virtual bool __cdecl IsAcceptTabKey() = NULL;
//是否密码录入方式
virtual bool __cdecl IsPassword() = NULL;
//是否显示光标
virtual bool __cdecl IsShowCursor() = NULL;
//设置为密码录入方式
virtual void __cdecl Password(bool bFlag) = NULL;
//设置录入字符集
virtual void __cdecl SetCharScope(enEditCharScope enCharScope) = NULL;
//设置光标位置
virtual void __cdecl SetCurPosition(WORD wPosition) = NULL;
//设置文本内容
virtual void __cdecl SetText(LPCTSTR lpText, WORD wLength=NULL)=NULL;
//显示光标
virtual void __cdecl ShowCursor(bool bFlag) = NULL;
};
#define VER_IGameObjectSlider INTERFACE_VERSION(1,1)
static const GUID IID_IGameObjectSlider={ 0xc2b89926, 0xf731, 0x4fbf, 0xb1, 0x18, 0x59, 0x7f, 0x19, 0x12, 0xaf, 0xe1};
interface IGameObjectSlider : public IUnknownEx
{
public:
//返回当前值
virtual WORD __cdecl GetCurrent()=NULL;
//返回增长方向
virtual WORD __cdecl GetDirection()=NULL;
//返回最大值
virtual WORD __cdecl GetMax()=NULL;
//返回最小值
virtual WORD __cdecl GetMin()=NULL;
//返回滑动类型
virtual WORD __cdecl GetSliderType()=NULL;
//返回步长值
virtual WORD __cdecl GetStep()=NULL;
//设置BAR的纹理区域
virtual void __cdecl SetBarRect(_RECT rcRect)=NULL;
//设置BLOCK的纹理区域
virtual void __cdecl SetBlockRect(_RECT rcRect)=NULL;
//设置当前值
virtual void __cdecl SetCurrent(WORD wCurrent)=NULL;
//设置增长方向
virtual void __cdecl SetDirection(WORD wDirection)=NULL;
//设置最大值
virtual void __cdecl SetMax(WORD wMax)=NULL;
//设置最小值
virtual void __cdecl SetMin(WORD wMin)=NULL;
//设置图片资源
virtual void __cdecl SetResource(CResource* pResource)=NULL;
//设置滑动类型
virtual void __cdecl SetSliderType(WORD wType)=NULL;
//设置步长值
virtual void __cdecl SetStep(WORD wStep)=NULL;
};
//拖动条对象接口 Randy 8月15日
#define VER_IGameObjectScrollBar INTERFACE_VERSION(1,1)
static const GUID IID_IGameObjectScrollBar={ 0xc2b89926, 0xf731, 0x4fbf, 0xb1, 0x18, 0x59, 0x7f, 0x19, 0x12, 0xaf, 0xe3};
interface IGameObjectScrollBar : public IUnknownEx
{
public:
//返回当前值
virtual WORD __cdecl GetCurrent()=NULL;
//返回最大值
virtual WORD __cdecl GetMax()=NULL;
//返回最小值
virtual WORD __cdecl GetMin()=NULL;
//返回滑动类型
virtual WORD __cdecl GetSliderType()=NULL;
//返回步长值
virtual WORD __cdecl GetStep()=NULL;
//设置当前值
virtual void __cdecl SetCurrent(WORD wCurrent)=NULL;
//设置最大值
virtual void __cdecl SetMax(WORD wMax)=NULL;
//设置最小值
virtual void __cdecl SetMin(WORD wMin)=NULL;
//设置滑动类型
virtual void __cdecl SetScrollBarType(WORD wType)=NULL;
//设置步长值
virtual void __cdecl SetStep(WORD wStep)=NULL;
//设置ScrollBar的区域
virtual void __cdecl SetScrollBarRect(_SIZE siSize)=NULL;
};
//导出类头文件
#ifndef OBJECT_COM_DLL
#include "Resource.h"
#include "GameObject.h"
#include "GameGroup.h"
#include "GameBufferPage.h"
#include "GameObjectText.h"
#include "GameObjectSprite.h"
#include "GameObjectAnim.h"
#include "GameObjectGraph.h"
#include "GameObjectParticle.h"
#include "GameObjectButton.h"
#include "GameObjectEdit.h"
#include "GameObjectSlider.h"
#include "GameObjectScrollBar.h"
#endif
extern OBJECT_COM_CLASS CResource* g_lpDefaultResource;
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -