MyActor.cpp 906 B

123456789101112131415161718192021222324252627282930313233343536
  1. // Fill out your copyright notice in the Description page of Project Settings.
  2. #include "MyActor.h"
  3. void AMyActor::SetViewportSize()
  4. {
  5. GEngine->GameViewport->SplitscreenInfo[0].PlayerData[0].OriginX = .05f; // default: 0.f
  6. GEngine->GameViewport->SplitscreenInfo[0].PlayerData[0].OriginY = .02f; // default: 0.f
  7. GEngine->GameViewport->SplitscreenInfo[0].PlayerData[0].SizeX = .4f; // default 1.f
  8. GEngine->GameViewport->SplitscreenInfo[0].PlayerData[0].SizeY = .2f; // default 1.f
  9. }
  10. // Sets default values
  11. AMyActor::AMyActor()
  12. {
  13. // Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it.
  14. PrimaryActorTick.bCanEverTick = true;
  15. }
  16. // Called when the game starts or when spawned
  17. void AMyActor::BeginPlay()
  18. {
  19. Super::BeginPlay();
  20. SetViewportSize();
  21. }
  22. // Called every frame
  23. void AMyActor::Tick(float DeltaTime)
  24. {
  25. Super::Tick(DeltaTime);
  26. }