ggballenv.cpp.bak

来自「一个symbian上成熟的小游戏源码」· BAK 代码 · 共 66 行

BAK
66
字号
// GGBallEnv.cpp: implementation of the CGGBallEnv class.
//
//////////////////////////////////////////////////////////////////////

#include "GGBallEnv.h"
#include <eikenv.h>

CFont* CGGBallEnv::iFont=NULL;
TSize CGGBallEnv::iSCreenSize=0;
TInt CGGBallEnv::iPaneHeight=22;
TInt CGGBallEnv::iMenuItemHeigt=22;

void CGGBallEnv::InitFont()
{
	iSCreenSize = CEikonEnv::Static()->ScreenDevice()->SizeInPixels();
	TInt fontHeightInPixel = 0;
	if ( ( iSCreenSize.iWidth == 176 && 208 == iSCreenSize.iHeight) ||
		( iSCreenSize.iWidth == 208 && 208 == iSCreenSize.iHeight) )
	{
		fontHeightInPixel = 3;
	}
	else if ( 240 == iSCreenSize.iWidth && 320 == iSCreenSize.iHeight )
	{
		fontHeightInPixel = 4;
	}
	else if ( 320 == iSCreenSize.iWidth && 240 == iSCreenSize.iHeight )
	{
		fontHeightInPixel = 4;
	}
	else if ( 352 == iSCreenSize.iWidth && 416 == iSCreenSize.iHeight )
	{
		fontHeightInPixel = 5;
	}
	else if ( 800 == iSCreenSize.iWidth && 352 == iSCreenSize.iHeight )
	{ 
		fontHeightInPixel = 10;
	}
	
	TFontSpec fs= TFontSpec(_L("CombinedChinesePlain12"), 12);
	CCoeEnv::Static()->ScreenDevice()->GetNearestFontInPixels(iFont, fs);  // 根据fs得到字体	
}

const CFont* CGGBallEnv::Font()
{
	return iFont;
}

void CGGBallEnv::Init()
{
	InitFont();	
}

TSize CGGBallEnv::ScreenSize()
{
	return iSCreenSize;	
}

TInt CGGBallEnv::PaneHeigth()
{
	return iPaneHeight;
}

TInt CGGBallEnv::MenuItemHeight()
{
	return iMenuItemHeigt;
}

⌨️ 快捷键说明

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