码迷,mamicode.com
首页 > 其他好文 > 详细

HUD渲染

时间:2015-11-25 23:16:30      阅读:665      评论:0      收藏:0      [点我收藏+]

标签:

创建贴图

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 );

HUD渲染

标签:

原文地址:http://www.cnblogs.com/bodboy/p/4996024.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!