本文整理汇总了C++中ImageView::SetParentOrigin方法的典型用法代码示例。如果您正苦于以下问题:C++ ImageView::SetParentOrigin方法的具体用法?C++ ImageView::SetParentOrigin怎么用?C++ ImageView::SetParentOrigin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ImageView
的用法示例。
在下文中一共展示了ImageView::SetParentOrigin方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreateEffectsView
EffectsView EffectsViewApp::CreateEffectsView( EffectsView::EffectType type, const Vector2& viewSize, int effectSize )
{
Toolkit::EffectsView effectsView = Toolkit::EffectsView::New(type);
// set control size
effectsView.SetSize( viewSize.width, viewSize.height );
// set effect size property
effectsView.SetProperty( EffectsView::Property::EFFECT_SIZE, effectSize );
// Create some content
// text
std::string text = ( type == EffectsView::DROP_SHADOW) ? "Drop Shadow" : "Emboss";
TextLabel textActor( TextLabel::New( text ) );
textActor.SetParentOrigin( ParentOrigin::CENTER_LEFT );
textActor.SetAnchorPoint( AnchorPoint::CENTER_LEFT );
textActor.SetSize( viewSize );
textActor.SetPosition( viewSize.width*0.4f, viewSize.height*0.3f );
textActor.SetProperty( TextLabel::Property::POINT_SIZE, DemoHelper::ScalePointSize(14.f) );
effectsView.Add( textActor );
// image
ImageView icon = ImageView::New( TEST_IMAGE );
icon.SetParentOrigin( ParentOrigin::CENTER_LEFT );
icon.SetAnchorPoint( AnchorPoint::CENTER_LEFT );
icon.SetX( viewSize.width*0.1f );
icon.SetSize( viewSize.height*0.8f, viewSize.height*0.8f );
effectsView.Add( icon );
AnimateEffectProperties( effectsView );
return effectsView;
}
示例2: AddImage
void AddImage( ScrollView& scrollView, Size& stageSize, int index )
{
ImageView imageView = ImageView::New( IMAGE_PATHS[index] );
imageView.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
imageView.SetSizeScalePolicy( SizeScalePolicy::FIT_WITH_ASPECT_RATIO );
imageView.SetParentOrigin( ParentOrigin::CENTER );
imageView.SetAnchorPoint( AnchorPoint::CENTER );
imageView.SetPosition( index * stageSize.x, 0 );
scrollView.Add( imageView );
}