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

📄 credits.h

📁 吃豆子游戏源码
💻 H
字号:
/**
 *	File	:	Credits.h
 *  Author	:	Kevin Lynx
 *	Date	:	2007/8.5
 */
#ifndef _CREDITS_H_
#define _CREDITS_H_

#include "../Singleton.h"


/**
 * FadeOutText
 *
 */
class FadeOutText
{
public:
	FadeOutText( stringw &text, IGUIFont *font, SColor color, 
				 position2d<s32> &pos, f32 speed );
	~FadeOutText();

	bool	update( float dt );
	void	render();
	void	reset();
private:
	stringw		mText;
	IGUIFont    *mFont;
	position2d<s32> mPos;
	f32			mSpeed;
	SColor	    mColor;
	f32			mAlpha;
};

/**
 * Credits
 *
 * implemnts the credits cartoon
 */
class Credits : public Singleton<Credits>
{
public:
	/** 
	 * common properties
	 *
	 */
	enum
	{
		FADE_SPEED = 200
	};
	enum
	{
		SHOW_TITLE,
		SHOW_LINE1,
		SHOW_LINE2,
		SHOW_LINE3,
		SHOW_LINE4,
		SHOW_LINE5,
		SHOW_LINE6,
		SHOW_LINE7
	};
public:
	/** 
	 * Constructor
	 *
	 */
	Credits( IrrlichtDevice *device );

	/**
	 * Destructor
	 *
	 */
	~Credits();

	/**
	 * init
	 *
	 */
	bool	init();

	/**
	 * enter
	 *
	 * called when enter the credits cartoon
	 */
	void	enter();

	/** 
	 * leave
	 *
	 */
	void	leave();

	/**
	 * update
	 *
	 */
	void	update( float dt );

	/**
	 * render
	 *
	 */
	void	render();

private:
	IrrlichtDevice *mDevice;
	
	FadeOutText	*mTitle;
	FadeOutText *mLine1;
	FadeOutText *mLine2;
	FadeOutText *mLine3;
	FadeOutText	*mLine4;
	FadeOutText *mLine5;
	FadeOutText *mLine6;
	FadeOutText *mLine7;

	int mState;
};

#endif // end _CREDITS_H_

⌨️ 快捷键说明

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