当前位置: 首页>>代码示例>>C++>>正文


C++ FColor函数代码示例

本文整理汇总了C++中FColor函数的典型用法代码示例。如果您正苦于以下问题:C++ FColor函数的具体用法?C++ FColor怎么用?C++ FColor使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了FColor函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: DrawDebugPoint

void UAStarAgentComponent::DrawDebugInformation()
{
  if (m_path->path.Num() == 0)
    return;

  for (int i = 0; i < m_path->path.Num() - 1; i++)
  {
    FVector pos1 = m_path->path[i];
    FVector pos2 = m_path->path[i + 1];

    DrawDebugPoint(
      GetWorld(),
      FVector(pos1.X, pos1.Y, pos1.Z),
      7,
      FColor(255, 255, 0)
      );

    DrawDebugLine(GetWorld(),
      FVector(pos1.X, pos1.Y, pos1.Z), FVector(pos2.X, pos2.Y, pos2.Z),
      FColor(255, 255, 0), false, -1, 0, 5.f
      );
  }

  DrawDebugPoint(
    GetWorld(),
    FVector(m_path->path.Last().X, m_path->path.Last().Y, m_path->path.Last().Z),
    7,
    FColor(255, 255, 0)
    );
}
开发者ID:xEricxD,项目名称:AIProject,代码行数:30,代码来源:AStarAgentComponent.cpp

示例2: GridWidget

/*------------------------------------------------------------------------------
FEditorCommonDrawHelper.
------------------------------------------------------------------------------*/
FEditorCommonDrawHelper::FEditorCommonDrawHelper()
	: GridWidget(0)
{
	bDrawGrid = true;
	bDrawPivot = true;
	bDrawBaseInfo = true;
	AxesLineThickness = 0.f;

	GridColorAxis = FColor(70, 70, 70);
	GridColorMajor = FColor(40, 40, 40);
	GridColorMinor = FColor(20, 20, 20);

	PerspectiveGridSize = HALF_WORLD_MAX1;
	NumCells = 64;

	bDrawWorldBox = false;
	bDrawKillZ = false;

	PivotColor = FColor(255,0,0);
	PivotSize = 0.02f;

	BaseBoxColor = FColor(0,255,0);

	DepthPriorityGroup=SDPG_World;

	GridDepthBias = 0.000001;
}
开发者ID:1vanK,项目名称:AHRUnrealEngine,代码行数:30,代码来源:EditorComponents.cpp

示例3: FEditorViewportClient

FMaterialEditorViewportClient::FMaterialEditorViewportClient(TWeakPtr<IMaterialEditor> InMaterialEditor, FPreviewScene& InPreviewScene, const TSharedRef<SMaterialEditorViewport>& InMaterialEditorViewport)
	: FEditorViewportClient(nullptr, &InPreviewScene, StaticCastSharedRef<SEditorViewport>(InMaterialEditorViewport))
	, MaterialEditorPtr(InMaterialEditor)
{
	// Setup defaults for the common draw helper.
	DrawHelper.bDrawPivot = false;
	DrawHelper.bDrawWorldBox = false;
	DrawHelper.bDrawKillZ = false;
	DrawHelper.bDrawGrid = false;
	DrawHelper.GridColorAxis = FColor(80,80,80);
	DrawHelper.GridColorMajor = FColor(72,72,72);
	DrawHelper.GridColorMinor = FColor(64,64,64);
	DrawHelper.PerspectiveGridSize = HALF_WORLD_MAX1;
	
	SetViewMode(VMI_Lit);
	
	EngineShowFlags.DisableAdvancedFeatures();
	EngineShowFlags.SetSnap(0);

	OverrideNearClipPlane(1.0f);
	bUsingOrbitCamera = true;

	// Don't want to display the widget in this viewport
	Widget->SetDefaultVisibility(false);
}
开发者ID:Codermay,项目名称:Unreal4,代码行数:25,代码来源:SMaterialEditorViewport.cpp

示例4: DrawDebugPoint

/// <summary> Draws one of the paths using one list from each list of lists </summary>
/// <param name="n"> The position, in each list of lists, of the list with the values for this path </param>
void UMovementTracker::DrawNthPath(size_t n)
{
	//Checks if there is no mistake in the different lists
	if (VectorList[n].Num() == TimeList[n].Num() && TimeList[n].Num() == NameList[n].Num())
	{
		//previous tells us if the previous point was drawn. It allows us to know if a line needs to be drawn between the points
		//but also tells us when the path's beginning was. It allows us to start at that point next update to save on resources.
		bool previous = false;
		for (size_t i = PathStartArray[n]; i < VectorList[n].Num(); i++)
		{
			if ((TimeLength <= 0 || TimeList[n][i] >= ElapsedTime - TimeLength) && TimeList[n][i] <= ElapsedTime && NameList[n][i] == GetOwner()->GetName())
			{
				DrawDebugPoint(World, VectorList[n][i], 20.0f, FColor(255, 0, 0));
				if (previous) //Draw the line between the previous point and this one
					DrawDebugLine(World, VectorList[n][i - 1], VectorList[n][i], FColor(0, 0, 255), false, -1.0f, (uint8)'\000', 5.0f);
				else //Sets the start of next update's sweep
					PathStartArray[n] = i;
				previous = true;
			}
			else
			{
				previous = false;
				if (previous) //We are at the end of the path that we want to draw, no need to continue checking the rest of the path
					break;
			}
		}
	}
}
开发者ID:ponchoa,项目名称:PathTracer,代码行数:30,代码来源:MovementTracker.cpp

示例5: appTrunc

/**
 * Dump allocation information.
 */
void FBestFitAllocator::DumpAllocs( FOutputDevice& Ar/*=*GLog*/ )
{		
	// Memory usage stats.
	INT				UsedSize		= 0;
	INT				FreeSize		= 0;
	INT				NumUsedChunks	= 0;
	INT				NumFreeChunks	= 0;
	
	// Fragmentation and allocation size visualization.
	INT				NumBlocks		= MemorySize / AllocationAlignment;
	INT				Dimension		= 1 + NumBlocks / appTrunc(appSqrt(NumBlocks));			
	TArray<FColor>	AllocationVisualization;
	AllocationVisualization.AddZeroed( Dimension * Dimension );
	INT				VisIndex		= 0;

	// Traverse linked list and gather allocation information.
	FMemoryChunk*	CurrentChunk	= FirstChunk;	
	while( CurrentChunk )
	{
		FColor VisColor;
		// Free chunk.
		if( CurrentChunk->bIsAvailable )
		{
			NumFreeChunks++;
			FreeSize += CurrentChunk->Size;
			VisColor = FColor(0,255,0);
		}
		// Allocated chunk.
		else
		{
			NumUsedChunks++;
			UsedSize += CurrentChunk->Size;
			
			// Slightly alternate coloration to also visualize allocation sizes.
			if( NumUsedChunks % 2 == 0 )
			{
				VisColor = FColor(255,0,0);
			}
			else
			{
				VisColor = FColor(192,0,0);
			}
		}

		for( INT i=0; i<(CurrentChunk->Size/AllocationAlignment); i++ )
		{
			AllocationVisualization(VisIndex++) = VisColor;
		}

		CurrentChunk = CurrentChunk->NextChunk;
	}

	check(UsedSize == AllocatedMemorySize);
	check(FreeSize == AvailableMemorySize);

	// Write out bitmap for visualization of fragmentation and allocation patterns.
	appCreateBitmap( TEXT("..\\..\\Binaries\\TextureMemory"), Dimension, Dimension, AllocationVisualization.GetTypedData() );
	Ar.Logf( TEXT("BestFitAllocator: Allocated %i KByte in %i chunks, leaving %i KByte in %i chunks."), UsedSize / 1024, NumUsedChunks, FreeSize / 1024, NumFreeChunks );
	Ar.Logf( TEXT("BestFitAllocator: %5.2f ms in allocator"), TimeSpentInAllocator * 1000 );
}
开发者ID:LiuKeHua,项目名称:colorful-engine,代码行数:63,代码来源:BestFitAllocator.cpp

示例6: FColor

void UThumbnailManager::SetupCheckerboardTexture()
{
	if (CheckerboardTexture)
	{
		return;
	}

	CheckerboardTexture = FImageUtils::CreateCheckerboardTexture(FColor(128, 128, 128), FColor(64, 64, 64), 32);
}
开发者ID:didixp,项目名称:Ark-Dev-Kit,代码行数:9,代码来源:ThumbnailManager.cpp

示例7: FColor

void FPaperEditorViewportClient::ModifyCheckerboardTextureColors()
{
	const FColor ColorOne = FColor(128, 128, 128);//TextureEditorPtr.Pin()->GetCheckeredBackground_ColorOne();
	const FColor ColorTwo = FColor(64, 64, 64);//TextureEditorPtr.Pin()->GetCheckeredBackground_ColorTwo();
	const int32 CheckerSize = 32;//TextureEditorPtr.Pin()->GetCheckeredBackground_Size();

	DestroyCheckerboardTexture();
	SetupCheckerboardTexture(ColorOne, ColorTwo, CheckerSize);
}
开发者ID:Codermay,项目名称:Unreal4,代码行数:9,代码来源:PaperEditorViewportClient.cpp

示例8: Super

UTextureEditorSettings::UTextureEditorSettings( const FObjectInitializer& ObjectInitializer )
	: Super(ObjectInitializer)
	, Background(TextureEditorBackground_SolidColor)
	, BackgroundColor(FColor::Black)
	, CheckerColorOne(FColor(128, 128, 128))
	, CheckerColorTwo(FColor(64, 64, 64))
	, CheckerSize(32)
	, FitToViewport(true)
	, TextureBorderColor(FColor::White)
	, TextureBorderEnabled(true)
{ }
开发者ID:kidaa,项目名称:UnrealEngineVR,代码行数:11,代码来源:TextureEditorClasses.cpp

示例9: FVector2D

int32 FSequencerTimeSliderController::DrawPlaybackRange(const FGeometry& AllottedGeometry, const FSlateRect& MyClippingRect, FSlateWindowElementList& OutDrawElements, int32 LayerId, const FScrubRangeToScreen& RangeToScreen, const FPaintPlaybackRangeArgs& Args) const
{
	if (!TimeSliderArgs.PlaybackRange.IsSet())
	{
		return LayerId;
	}

	TRange<float> PlaybackRange = TimeSliderArgs.PlaybackRange.Get();

	float PlaybackRangeL = RangeToScreen.InputToLocalX(PlaybackRange.GetLowerBoundValue()) - 1;
	float PlaybackRangeR = RangeToScreen.InputToLocalX(PlaybackRange.GetUpperBoundValue()) + 1;

	FSlateDrawElement::MakeBox(
		OutDrawElements,
		LayerId+1,
		AllottedGeometry.ToPaintGeometry(FVector2D(PlaybackRangeL, 0.f), FVector2D(Args.BrushWidth, AllottedGeometry.Size.Y)),
		Args.StartBrush,
		MyClippingRect,
		ESlateDrawEffect::None,
		FColor(32, 128, 32)	// 120, 75, 50 (HSV)
	);

	FSlateDrawElement::MakeBox(
		OutDrawElements,
		LayerId+1,
		AllottedGeometry.ToPaintGeometry(FVector2D(PlaybackRangeR - Args.BrushWidth, 0.f), FVector2D(Args.BrushWidth, AllottedGeometry.Size.Y)),
		Args.EndBrush,
		MyClippingRect,
		ESlateDrawEffect::None,
		FColor(128, 32, 32)	// 0, 75, 50 (HSV)
	);

	// Black tint for excluded regions
	FSlateDrawElement::MakeBox(
		OutDrawElements,
		LayerId+1,
		AllottedGeometry.ToPaintGeometry(FVector2D(0.f, 0.f), FVector2D(PlaybackRangeL, AllottedGeometry.Size.Y)),
		FEditorStyle::GetBrush("WhiteBrush"),
		MyClippingRect,
		ESlateDrawEffect::None,
		FLinearColor::Black.CopyWithNewOpacity(0.2f)
	);

	FSlateDrawElement::MakeBox(
		OutDrawElements,
		LayerId+1,
		AllottedGeometry.ToPaintGeometry(FVector2D(PlaybackRangeR, 0.f), FVector2D(AllottedGeometry.Size.X - PlaybackRangeR, AllottedGeometry.Size.Y)),
		FEditorStyle::GetBrush("WhiteBrush"),
		MyClippingRect,
		ESlateDrawEffect::None,
		FLinearColor::Black.CopyWithNewOpacity(0.2f)
	);
	return LayerId + 1;
}
开发者ID:RandomDeveloperM,项目名称:UE4_Hairworks,代码行数:54,代码来源:TimeSliderController.cpp

示例10: check

FColor UInterpTrackVectorBase::GetKeyColor(int32 SubIndex, int32 KeyIndex, const FColor& CurveColor)
{
	check( SubIndex >= 0 && SubIndex < 3);
	check( KeyIndex >= 0 && KeyIndex < VectorTrack.Points.Num() );

	if(SubIndex == 0)
		return FColor(255,0,0);
	else if(SubIndex == 1)
		return FColor(0,255,0);
	else
		return FColor(0,0,255);
}
开发者ID:1vanK,项目名称:AHRUnrealEngine,代码行数:12,代码来源:InterpolationCurveEd.cpp

示例11: BatchPxRenderBufferLines

static void BatchPxRenderBufferLines(class ULineBatchComponent& LineBatcherToUse, const PxRenderBuffer& DebugData)
{
	int32 NumPoints = DebugData.getNbPoints();
	if (NumPoints > 0)
	{
		const PxDebugPoint* Points = DebugData.getPoints();
		for (int32 i = 0; i<NumPoints; i++)
		{
			LineBatcherToUse.DrawPoint(P2UVector(Points->pos), FColor((uint32)Points->color), 2, SDPG_World);

			Points++;
		}
	}

	// Build a list of all the lines we want to draw
	TArray<FBatchedLine> DebugLines;

	// Add all the 'lines' from PhysX
	int32 NumLines = DebugData.getNbLines();
	if (NumLines > 0)
	{
		const PxDebugLine* Lines = DebugData.getLines();
		for (int32 i = 0; i<NumLines; i++)
		{
			new(DebugLines)FBatchedLine(P2UVector(Lines->pos0), P2UVector(Lines->pos1), FColor((uint32)Lines->color0), 0.f, 0.0f, SDPG_World);
			Lines++;
		}
	}

	// Add all the 'triangles' from PhysX
	int32 NumTris = DebugData.getNbTriangles();
	if (NumTris > 0)
	{
		const PxDebugTriangle* Triangles = DebugData.getTriangles();
		for (int32 i = 0; i<NumTris; i++)
		{
			new(DebugLines)FBatchedLine(P2UVector(Triangles->pos0), P2UVector(Triangles->pos1), FColor((uint32)Triangles->color0), 0.f, 0.0f, SDPG_World);
			new(DebugLines)FBatchedLine(P2UVector(Triangles->pos1), P2UVector(Triangles->pos2), FColor((uint32)Triangles->color1), 0.f, 0.0f, SDPG_World);
			new(DebugLines)FBatchedLine(P2UVector(Triangles->pos2), P2UVector(Triangles->pos0), FColor((uint32)Triangles->color2), 0.f, 0.0f, SDPG_World);
			Triangles++;
		}
	}

	// Draw them all in one call.
	if (DebugLines.Num() > 0)
	{
		LineBatcherToUse.DrawLines(DebugLines);
	}
}
开发者ID:didixp,项目名称:Ark-Dev-Kit,代码行数:49,代码来源:PhysScene.cpp

示例12: GetWorld

void AWeapon::DoDamage(FHitResult& ObjectHit)
{
	FVector ImpactPoint;
	FVector ImpactNormal;	
	ImpactPoint.X = ObjectHit.ImpactPoint.X;
	ImpactPoint.Y = ObjectHit.ImpactPoint.Y;
	ImpactPoint.Z = ObjectHit.ImpactPoint.Z;
	ImpactNormal.X = ObjectHit.ImpactNormal.X; //Use this data for placing decals if bullets hit walls etc.
	ImpactNormal.Y = ObjectHit.ImpactNormal.Y;
	ImpactNormal.Z = ObjectHit.ImpactNormal.Z;
	const UWorld* World = GetWorld();
	if (World)
	{
		DrawDebugSphere(World, ImpactPoint, 10.0f, 8, FColor(255, 0, 0), false, 3, 0);
		APlayerController* PlayerController = Cast<APlayerController>(WeaponOwner->GetController());
		if (PlayerController != nullptr)
		{
			const AActor* HitActor = ObjectHit.GetActor();
			if (HitActor != nullptr)
			{
				if (HitActor->IsA(AEnemy::StaticClass()))
				{
					AEnemy* Enemy = (AEnemy*)HitActor;
					TSubclassOf<UDamageType> const ValidDamageTypeClass = TSubclassOf<UDamageType>(UDamageType::StaticClass());
					FDamageEvent DamageEvent(ValidDamageTypeClass);
					Enemy->TakeDamage(Config.Damage, DamageEvent, PlayerController, this);
				}
			}
		}
	}
}
开发者ID:rcktscnc,项目名称:unreal-project,代码行数:31,代码来源:Weapon.cpp

示例13: FLinearColor

FSlateColor SAmethystWaitDialog::GetTextColor() const
{
	//instead of going from black -> white, go from white -> grey.
	float fAlpha = 1.0f - TextColorCurve.GetLerp();
	fAlpha = fAlpha * 0.5f + 0.5f;
	return FLinearColor(FColor(155, 164, 182, FMath::Clamp((int32)(fAlpha * 255.0f), 0, 255)));
}
开发者ID:1337programming,项目名称:amethystforest,代码行数:7,代码来源:AmethystGameInstance.cpp

示例14: Super

AValorMinionSpawner::AValorMinionSpawner(const FObjectInitializer& ObjectInitializer)
	: Super(ObjectInitializer)
{
	GetCapsuleComponent()->InitCapsuleSize(40.0f, 92.0f);

#if WITH_EDITORONLY_DATA
	ArrowComponent = CreateEditorOnlyDefaultSubobject<UArrowComponent>(TEXT("Arrow"));

	if (!IsRunningCommandlet())
	{
		// Structure to hold one-time initialization
		struct FConstructorStatics
		{
			ConstructorHelpers::FObjectFinderOptional<UTexture2D> PlayerStartTextureObject;
			FName ID_PlayerStart;
			FText NAME_PlayerStart;
			FName ID_Navigation;
			FText NAME_Navigation;
			FConstructorStatics()
				: PlayerStartTextureObject(TEXT("/Engine/EditorResources/S_Player"))
				, ID_PlayerStart(TEXT("PlayerStart"))
				, NAME_PlayerStart(NSLOCTEXT("SpriteCategory", "PlayerStart", "Player Start"))
				, ID_Navigation(TEXT("Navigation"))
				, NAME_Navigation(NSLOCTEXT("SpriteCategory", "Navigation", "Navigation"))
			{
			}
		};
		static FConstructorStatics ConstructorStatics;

		if (GetGoodSprite())
		{
			GetGoodSprite()->Sprite = ConstructorStatics.PlayerStartTextureObject.Get();
			GetGoodSprite()->RelativeScale3D = FVector(0.5f, 0.5f, 0.5f);
			GetGoodSprite()->SpriteInfo.Category = ConstructorStatics.ID_PlayerStart;
			GetGoodSprite()->SpriteInfo.DisplayName = ConstructorStatics.NAME_PlayerStart;
		}
		if (GetBadSprite())
		{
			GetBadSprite()->SetVisibility(false);
		}

		if (ArrowComponent)
		{
			ArrowComponent->ArrowColor = FColor(150, 200, 255);

			ArrowComponent->ArrowSize = 1.0f;
			ArrowComponent->bTreatAsASprite = true;
			ArrowComponent->SpriteInfo.Category = ConstructorStatics.ID_Navigation;
			ArrowComponent->SpriteInfo.DisplayName = ConstructorStatics.NAME_Navigation;
			ArrowComponent->SetupAttachment(GetCapsuleComponent());
			ArrowComponent->bIsScreenSizeScaled = true;
		}
	}
#endif // WITH_EDITORONLY_DATA

	if (GWorld && GWorld->HasBegunPlay())
	{
		ensure(SpawnTeam != EValorTeam::Invalid);
	}
}
开发者ID:Shirasho,项目名称:ValorGame,代码行数:60,代码来源:ValorMinionSpawner.cpp

示例15: FColor

void FEdModeGeometry::RenderEdge( const FSceneView* View, FPrimitiveDrawInterface* PDI )
{
	for( int32 ObjectIdx = 0 ; ObjectIdx < GeomObjects.Num() ; ++ObjectIdx )
	{
		const FGeomObject* GeometryObject = GeomObjects[ObjectIdx];
		const FColor WireColor = GeometryObject->GetActualBrush()->GetWireColor();

		// Edges
		for( int32 EdgeIdx = 0 ; EdgeIdx < GeometryObject->EdgePool.Num() ; ++EdgeIdx )
		{
			const FGeomEdge* GeometryEdge = &GeometryObject->EdgePool[EdgeIdx];
			const FColor Color = GeometryEdge->IsSelected() ? FColor(255,128,64) : WireColor;

			PDI->SetHitProxy( new HGeomEdgeProxy(const_cast<FGeomObject*>(GeometryObject),EdgeIdx) );
			{
				FVector V0 = GeometryObject->VertexPool[ GeometryEdge->VertexIndices[0] ];
				FVector V1 = GeometryObject->VertexPool[ GeometryEdge->VertexIndices[1] ];
				const FTransform ActorToWorld = GeometryObject->GetActualBrush()->ActorToWorld();

				V0 = ActorToWorld.TransformPosition( V0 );
				V1 = ActorToWorld.TransformPosition( V1 );

				PDI->DrawLine( V0, V1, Color, SDPG_Foreground );
			}
			PDI->SetHitProxy( NULL );
		}
	}
}
开发者ID:Tigrouzen,项目名称:UnrealEngine-4,代码行数:28,代码来源:GeometryEdMode.cpp


注:本文中的FColor函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。