示例#1
0
void HitAnimation::Draw()
{
	if ( active ) 
	{
		if ( animation == HIT_ANIMATION::HIT_ANIM_1)
			SetSpriteUVCoordinates	( sprite, HIT_1_UV);
		if ( animation == HIT_ANIMATION::HIT_ANIM_2)
			SetSpriteUVCoordinates	( sprite, HIT_2_UV);

		MoveSprite(sprite, pos.x, pos.y);
		//RotateSpriteToVector(sprite, direction);
		//RotateSprite(sprite, 270.0f);
		DrawSprite(sprite);
	}
}
示例#2
0
// sets UV coordinates of sprite's sheet
void Sprite::SetUV(int a_iSheet)
{
	float tempXmin, tempYmin, tempXmax, tempYmax;
	tempXmin = m_vSpriteSheet[a_iSheet].m_fXmin;
	tempYmin = m_vSpriteSheet[a_iSheet].m_fYmin;
	tempXmax = m_vSpriteSheet[a_iSheet].m_fXmax;
	tempYmax = m_vSpriteSheet[a_iSheet].m_fYmax;

	SetSpriteUVCoordinates(m_iSpriteId, tempXmin, tempYmin, tempXmax, tempYmax);
}