📄 gameview.h
字号:
// ***************************************************************
// GameView version: 1.0
// -------------------------------------------------------------
// File Name: GameView.h
// Created: 2007/07/18
// Modified: 2007/07/18 16:12
// 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_VIEW_HEAD_FILE
#define GAME_VIEW_HEAD_FILE
#pragma once
#include "FrameObject.h"
class CGameScene;
class CGameLayer;
//***************************************************************
// 视点类。控制所有场景的视点显示范围,可为场景提供多个视角切
// 换。(目前只能一个视图)
//***************************************************************
class FRAME_COM_CLASS CGameView :
public CFrameObject
{
protected:
//场景列表
CListTemplate<CGameScene*, _CString> m_lstGameScenes;
_LPRECT m_lpActionRect;
WORD m_wActionAreaCount;
public:
//构造函数
CGameView(_CString szName="default", _SIZE siSize=_SIZE(0, 0));
//析构函数
virtual ~CGameView(void);
public:
//设置动作区域
virtual void __cdecl SetActionArea(_LPRECT lpRect, WORD wCount);
//是否激活动作区域
virtual WORD __cdecl IsHitActionArea(float x, float y);
//创建元素
virtual CGameScene* __cdecl Create(_CString szName, INT_PTR nPosition = LISTTEMPLATE_LAST_ITEM);
//计算容器坐标
virtual void __cdecl CalcContainerPosition();
//管理模板方法
public:
//返回指定的路径下的对象
IGameObject* GetObject(LPCTSTR szPath);
//查找指定坐标下的对象
bool FindObject(float x, float y, CGameScene** pGameScene, CGameLayer** pGameLayer, IGameObject** pIGameObject);
//交换深度
virtual void __cdecl SwitchDepth(IUnknownEx* pIObject1, IUnknownEx* pIObject2);
//交换深度
virtual void __cdecl SwitchDepth(IUnknownEx* pIObject, DWORD dwNewDepth);
//管理模板方法
public:
//返回场景数
virtual INT_PTR __cdecl GetLength();
//返回场景
virtual CGameScene* __cdecl Get(INT_PTR nIndex);
//返回场景
virtual CGameScene* __cdecl GetBy(LPCTSTR szKey);
//返回场景
virtual CGameScene* __cdecl operator[](INT_PTR nIndex);
//返回场景
virtual CGameScene* __cdecl operator[](LPCTSTR szKey);
//添加场景
virtual bool __cdecl Add(CGameScene* pGameScene, _CString szName, INT_PTR nPosition = LISTTEMPLATE_LAST_ITEM);
//移除场景
virtual bool __cdecl Remove(INT_PTR nIndex);
//移除场景
virtual bool __cdecl Remove(_CString szKey);
//移除所有对象
virtual bool __cdecl ClearAll();
//预渲染视图
virtual void __cdecl PreRender(WPARAM wParam=NULL);
//渲染视图
virtual void __cdecl Render(WPARAM wParam=NULL);
//模板方法
public:
//是否有效
virtual bool __cdecl IsValid() { return AfxIsValidAddress(this,sizeof(CGameView))?true:false;};
//释放对象
virtual bool __cdecl Release();
//接口查询
virtual void * __cdecl QueryInterface(const IID & Guid, DWORD dwQueryVer);
};
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -