本文整理汇总了C++中Sprite::GetSurface方法的典型用法代码示例。如果您正苦于以下问题:C++ Sprite::GetSurface方法的具体用法?C++ Sprite::GetSurface怎么用?C++ Sprite::GetSurface使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sprite
的用法示例。
在下文中一共展示了Sprite::GetSurface方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Particle
BodyMemberParticle::BodyMemberParticle(Sprite& spr, const Point2i& position)
: Particle("body_member_particle")
, angle_rad(0)
{
SetCollisionModel(true, false, false);
m_time_left_to_live = 100;
// Bug #17408: make sure there's an available surface for the sprite
spr.RefreshSurface();
image = new Sprite(spr.GetSurface());
image->EnableCaches(false, 0); // Some generic particle code requires it to be flipped
ASSERT(image->GetWidth() && image->GetHeight());
SetXY(position);
SetSize(image->GetSize());
SetOnTop(true);
MSG_DEBUG("random.get", "BodyMemberParticle::BodyMemberParticle(...) speed vector length");
Double speed_vector_length = (Double)RandomSync().GetInt(10, 15);
MSG_DEBUG("random.get", "BodyMemberParticle::BodyMemberParticle(...) speed vector angle");
Double speed_vector_angle = - RandomSync().GetDouble(0, 3);
SetSpeed(speed_vector_length, speed_vector_angle);
}