inline Vector2 TouchButton::GetButtonSize(const SpritePtr& sprite)
{
	Vector2 frameSize(sprite->GetBitmapSizeF());
	if (sprite->GetRect().size != Vector2(0, 0))
	{
		frameSize = sprite->GetRect().size;
	}
	return frameSize;
}
Vector2 ETHScriptWrapper::GetSpriteSize(const str_type::string &name)
{
	SpritePtr pSprite = LoadAndGetSprite(name);
	if (pSprite)
	{
		return pSprite->GetBitmapSizeF();
	}
	else
	{
		return Vector2(0,0);
	}
}
Exemple #3
0
float ComputeSplashScale(const Vector2& screenSize)
{
	const float defaultScale = 1.0f;
	const Vector2 size(splashSprite->GetBitmapSizeF() * defaultScale);
	if (size.x > screenSize.x)
	{
		return screenSize.x / size.x;
	}
	else
	{
		return defaultScale;
	}
}