⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 puthz.h

📁 网页游戏赤壁
💻 H
字号:
/////////////
//	putHZ.h			:	v0011
//	Written by		:	Liu Gang
//	Compiler		:	Microsoft Visual C++ 4.0 & DirectX
//	Library			:	DDraw.Lib
//	Copyright (C)	:	1996 WayAhead Corporation 
//	v0010			:	Oct.4.1996
//	v0011			:	Apr.9.1997, change the name of GetSurface() to GetDDSurface()
//	v0012			:	Sep.2.1997, add an English version of PloyTextOut()
/////////////
// header file

#ifndef	__PUTHZ_H__
#define	__PUTHZ_H__
///////////////////

#include "DDApi.h"

#define	CHAR_WIDTH		8
#define	CHAR_HEIGHT		16

class CDDText
{
	HDC myhdc;
	SIZE m_bmpsize;			
	BYTE *m_mybytes;
	HBITMAP myhbmpsec;
	HGDIOBJ oldbmp;

	RECT	m_rcClient;
	COLORREF	m_textcolor;
	DWORD	m_dwColorCaps;
	int		m_nCol;			// max charactor can be displayed
	int		m_nRow;			// max line can be displayed
	int		m_nLineDist;	// line distance
	class	CDDSurface	m_Face;

	public:
		CDDText();
		~CDDText();
	
	//prepare for MyDrawText and MyTextOut
	BOOL BeginText( int nCol, int nRow=1, BOOL bColorKey=TRUE );
	//delete objects used by MyDrawText and MyTextOut
	void EndText();

	// set text color
	void SetTextColor( COLORREF	color ){m_textcolor = color;}

	// set line distance
	void SetLineDist( int nDist ){m_nLineDist = nDist;}

	// get my surface
	class CDDSurface * GetDDSurface(){return &m_Face;}

protected:
	int ReadData( LPCTSTR string, int nLen );

	// draw
public:
	BOOL MyDrawText( LPDIRECTDRAWSURFACE2 pSurface, LPCTSTR lpszString, int len, LPRECT lpRect, UINT nFormat);
	BOOL MyDrawText( LPDIRECTDRAWSURFACE2 pSurface, LPCTSTR lpszString, LPRECT lpRect, UINT nFormat);
	BOOL MyTextOut( LPDIRECTDRAWSURFACE2 pSurface, int x, int y, LPCTSTR String, int len);
	BOOL MyTextOut( LPDIRECTDRAWSURFACE2 pSurface, int x, int y, LPCTSTR String);
	BOOL PolyTextOut( LPDIRECTDRAWSURFACE2 pSurface, int x, int y, const char *pString );
};


// 打开和关闭字库
int HZ_OpenLib( char *filename );
void HZ_CloseLib();

///////////////////
#endif

⌨️ 快捷键说明

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