Esempio n. 1
0
void para2(Pointf& xy, double t) {xy = Pointf(0.5*cos(6*M_PI*t)+3*t-1, 1.5+0.5*sin(6*M_PI*t));}
Esempio n. 2
0
void para1(Pointf& xy, double t) {xy = Pointf(cos(2*M_PI*t), sin(2*M_PI*t));}
Esempio n. 3
0
Pointf opara1(double t) {return Pointf(0.5*cos(2*M_PI*t), 0.5*sin(2*M_PI*t));}
Esempio n. 4
0
void para3p(Pointf& xy, double t, double a) 			{xy = Pointf(a+(0.5+t)*cos(6*M_PI*t),(0.5+t)*sin(6*M_PI*t));}
Esempio n. 5
0
void para1p(Pointf& xy, double t, double a, double b) 	{xy = Pointf(a*cos(2*M_PI*t),b*sin(2*M_PI*t));}
Esempio n. 6
0
void Monster::Draw(POINT ptMap)
{
	IEngine* pEngine = GetEngine();
	IVideo* pVideo = pEngine->getVideo();
	easy2d::IFont* pFont = pEngine->getFont();

	// »­¹ÖÎïÉíÌåͼƬ
	int x = m_pt.x - ptMap.x;
	int y = m_pt.y - ptMap.y;
	mSpriteSheet.render(x+CXTILE/2, y+CYTILE/2);
	if (CommData::isShowMiniMap) {
		pVideo->drawSolidRect(Pointf(x, y), Pointf(x+CXTILE, y+CYTILE), 0x50FFFF00);
		pVideo->drawRect(Pointf(x, y), Pointf(x+CXTILE, y+CYTILE), RED, 2.0f);
	}

	if (m_isMouseMove || m_isSelected) {
		// Ñ¡ÖÐ״̬
		m_nameColor = RED;
		m_Effect = EF_RED;
		int x1=0, y1=0, x2=0, y2=0;
		
		// ³öÉúÇøÓò
		x = m_pt.x - ptMap.x;
		y = m_pt.y - ptMap.y;
		int birthW = m_info.birthRect.cx * CXTILE;
		int birthH = m_info.birthRect.cy * CYTILE;
		x1 = x - birthW;
		y1 = y - birthH;
		x2 = x + birthW + CXTILE;
		y2 = y + birthH + CYTILE;
		pVideo->drawRect(Pointf(x1, y1), Pointf(x2, y2), YELLOW);

		// ÊÓÒ°(¹¥»÷)·¶Î§
		x = m_pt.x - ptMap.x;
		y = m_pt.y - ptMap.y;
		int viewW = m_info.view * CXTILE;
		int viewH = m_info.view * CYTILE;
		x1 = x - viewW;
		y1 = y - viewH;
		x2 = x + viewW + CXTILE;
		y2 = y + viewH + CYTILE;
		pVideo->drawRect(Pointf(x1, y1), Pointf(x2, y2), RED);
	} else {
		// ·ÇÑ¡ÖÐ״̬
		m_nameColor = YELLOW;
		m_Effect = EF_NORMAL;
	}

	// »æÖÆÃû×Ö¡¢ÊýÁ¿¡¢µôÂä±àºÅ
	CString strName = m_name.c_str();
	if (m_num > 1) {
		CString strNum;
		strNum.Format("(ÊýÁ¿*%d)", m_num);
		strName += strNum;
	}
	if (m_info.dropInfo[0].dropId != 0) {
		CString strDrop;
		strDrop.Format("[µôÂä%d]", m_info.dropInfo[0].dropId);
		strName += strDrop;
	}

	// »­¹ÖÎïÃû×Ö
	int frameHeight = 0;
	int offsetX = (int)strName.GetLength() * 4 - CXTILE/2;
	FRAME_INFO* frm = mSpriteSheet.getFrame(0);
	if (frm != NULL) {
		frameHeight = mSpriteSheet.getFrame(0)->height;
	} else {
		frameHeight = 86;
	}

	stFontEffect fontEff;
	pFont->drawString(x-offsetX, y-frameHeight, strName, m_nameColor, fontEff);
}