标签:
创建贴图
UTexture2D* CrosshairTex = NULL;
static ConstructorHelpers::FObjectFinder<UTexture2D> CrosshiarTexObj(TEXT("/Game/FirstPerson/Textures/FirstPersonCrosshair"));
CrosshairTex = CrosshiarTexObj.Object;
坐标
const FVector2D Center(Canvas->ClipX * 0.5f, Canvas->ClipY * 0.5f);
const FVector2D CrosshairDrawPosition( (Center.X - (CrosshairTex->GetSurfaceWidth() * 0.5)),
(Center.Y - (CrosshairTex->GetSurfaceHeight() * 0.5f)) );
绘制
FCanvasTileItem TileItem( CrosshairDrawPosition, CrosshairTex->Resource, FLinearColor::White);
TileItem.BlendMode = SE_BLEND_Translucent;
Canvas->DrawItem( TileItem );
标签:
原文地址:http://www.cnblogs.com/bodboy/p/4996024.html