mousezoneclass.h

来自「<B>很多DirectX 9.0游戏编程源码例子</B>」· C头文件 代码 · 共 50 行

H
50
字号
//-----------------------------------------------------------------------------
// Name: MouseZoneClass.h
//
// Description: Class to simplify game menu navigation with the mouse
//
// File Function: Header file for the class
//
// Code: 
//		Copyright (c) 2002 LostLogic Corporation. All rights reserved.
//
// Local Files Required:
//		MouseZoneClass.h
//		MouseZoneClass.cpp
//-----------------------------------------------------------------------------
#ifndef MOUSEZONECLASS_H
#define MOUSEZONECLASS_H

#include <string.h>
#include <stdio.h>
#include <iostream.h>
#include <stdlib.h>

struct stHotSpot
{
	short	m_shZoneXPos;
	short	m_shZoneYPos;
	short	m_shZoneWidth;
	short	m_shZoneHeight;
	bool	m_bActive;
	short	m_shClickType;
	char	*m_szZoneName;
};

class MouseZoneClass
{
	private:
		int			m_iMaxZones;
		stHotSpot	*m_HotSpots;
	
	public:
		MouseZoneClass( void );
		~MouseZoneClass( void );
		void vInitialize( int iMaxZones );
		void vFreeZones( void );
		int iAddZone( char *szZoneName, short shX, short shY, short shWidth, short shHeight, short shClickType );
		int iRemoveZone( char *szZoneName );
		bool bCheckZones( short shX, short shY, char *szZoneHit, bool bLeftDown, bool bRightDown );
};

#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?