📄 gameobjectsprite.h
字号:
// ***************************************************************
// GameObjectSprite version: 1.0
// -------------------------------------------------------------
// File Name: GameObjectSprite.h
// Created: 2007/07/18
// Modified: 2007/07/18 15:50
// Author: William.Liang
// Msn: lwq49@msn.com
// Email: lwq49@21cn.com, lwq49@msn.com
// Description:
//
// Purpose:
// -------------------------------------------------------------
// license:
//
// The contents of this file are subject to the Mozilla Public
// License Version 1.1 (the "License"); you may not use this file
// except in compliance with the License. You may obtain a copy
// of the License at http://www.mozilla.org/MPL/ Software dis-
// tributed under the License is distributed on an "AS IS"
// basis, WITHOUT WARRANTY OF ANY KIND, either express or im-
// plied. See the License for the specific language governing
// rights and limitations under the License.
//
// The Initial Developer of the Original Code is William.Liang .
// Copyright (C) 2007 - All Rights Reserved.
// ***************************************************************
#ifndef GAME_OBJECT_SPRITE_HEAD_FILE
#define GAME_OBJECT_SPRITE_HEAD_FILE
#pragma once
#include "gameobject.h"
//***************************************************************
// 精灵对象,提供简单的帖图处理功能。
//***************************************************************
class OBJECT_COM_CLASS CGameObjectSprite :
public IGameObjectSprite, public CGameObject
{
private:
hgeSprite* m_hgeSprite; // 精灵类指针
_RECT m_rcTextureSize; // 纹理大小
DWORD m_dwColor; // 颜色值
CResource* m_pResource; // 保存资源指针
public:
//构造函数
CGameObjectSprite(void);
//析构函数
virtual ~CGameObjectSprite(void);
//公共相关方法
public:
//对象创建
virtual bool __cdecl Create(LPCTSTR lpName, _SIZE siSize, CResource* pResource);
//对象创建 Randy 8月15日
virtual bool __cdecl Create(LPCTSTR lpName, _RECT rcRes, CResource* pResource);
//渲染对象
virtual void __cdecl Render(WPARAM wParam=NULL);
public:
//设置中心
virtual void __cdecl SetAnchorPosition(_POINT piPoint);
//设置中心
virtual void __cdecl SetAnchorPositionOffset(_POINT piPoint);
//设置镜像
virtual void __cdecl SetFlip(bool bX, bool bY);
//设置纹理大小
virtual void __cdecl SetTextureSize(_RECT rcSize);
//返回纹理大小
virtual _RECT __cdecl GetTextureSize();
//设置颜色
virtual void __cdecl SetColor(DWORD dwColor);
//返回颜色
virtual DWORD __cdecl GetColor();
//设置透明
virtual void __cdecl SetAlpha(WORD wAlpha);
//设置透明
virtual void __cdecl SetAlphaOffset(WORD wAlpha);
//设置绑定模式
virtual void __cdecl SetBlendMode(WORD wMode);
//返回绑定模式
virtual WORD __cdecl GetBlendMode();
//设置资源
virtual CResource* __cdecl GetResource();
//返回资源
virtual void __cdecl SetResource(CResource* pResource);
//模板方法
public:
//是否有效
virtual bool __cdecl IsValid() { return AfxIsValidAddress(this,sizeof(CGameObjectSprite))?true:false;};
//释放对象
virtual bool __cdecl Release() { if (IsValid()) delete this; return true; };
//接口查询
virtual void * __cdecl QueryInterface(const IID & Guid, DWORD dwQueryVer);
public:
//操作重载
CGameObjectSprite& operator=(CGameObjectSprite& GameObject);
};
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -