diff --git a/README.md b/README.md index ca4ec5d..8b111ba 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,10 @@ -# Sharing +iOS Sharing +=== A plugin for Unreal Engine 4 that enables native sharing on iOS + +How to use: +--- + +1. Create a blueprint with both "screenshot" and "sharing" components added to the component tree +2. Take a screenshot using the default Unreal command: "Execute Console Command" node with the value "SHOT" or "highresshot 1" +3. With the screenshot component selected in the details pane select "Screenshot Captured Image" to create an event that listens to when unreal has created a screenshot. Use the image output as in input for the "Share" BP node diff --git a/Source/Sharing/Classes/ScreenshotComponent.h b/Source/Sharing/Classes/ScreenshotComponent.h index 7da2de6..ff947ce 100644 --- a/Source/Sharing/Classes/ScreenshotComponent.h +++ b/Source/Sharing/Classes/ScreenshotComponent.h @@ -5,6 +5,7 @@ #pragma once +#include "Components/ActorComponent.h" #include "ScreenshotComponent.generated.h" USTRUCT(BlueprintType) diff --git a/Source/Sharing/Classes/SharingComponent.h b/Source/Sharing/Classes/SharingComponent.h index 6a14106..350fdf7 100644 --- a/Source/Sharing/Classes/SharingComponent.h +++ b/Source/Sharing/Classes/SharingComponent.h @@ -5,6 +5,7 @@ #pragma once +#include "Components/ActorComponent.h" #include "SharingComponent.generated.h" UCLASS(ClassGroup=Sharing, HideCategories=(Activation, "Components|Activation", Collision), meta=(BlueprintSpawnableComponent)) diff --git a/Source/Sharing/Classes/SharingFunctions.h b/Source/Sharing/Classes/SharingFunctions.h index 7ef4958..f6f3f22 100644 --- a/Source/Sharing/Classes/SharingFunctions.h +++ b/Source/Sharing/Classes/SharingFunctions.h @@ -5,6 +5,9 @@ #pragma once +#include "UObject/Object.h" +#include "UObject/ScriptMacros.h" +#include "ScreenshotComponent.h" #include "SharingFunctions.generated.h" UCLASS(NotBlueprintable) diff --git a/Source/Sharing/Private/ScreenshotComponent.cpp b/Source/Sharing/Private/ScreenshotComponent.cpp index b979f30..1160226 100644 --- a/Source/Sharing/Private/ScreenshotComponent.cpp +++ b/Source/Sharing/Private/ScreenshotComponent.cpp @@ -4,6 +4,7 @@ // #include "SharingPrivatePCH.h" +#include "ScreenshotComponent.h" void UScreenshotComponent::OnRegister() { diff --git a/Source/Sharing/Private/SharingComponent.cpp b/Source/Sharing/Private/SharingComponent.cpp index f712c36..584415c 100644 --- a/Source/Sharing/Private/SharingComponent.cpp +++ b/Source/Sharing/Private/SharingComponent.cpp @@ -4,6 +4,7 @@ // #include "SharingPrivatePCH.h" +#include "SharingComponent.h" void USharingComponent::OnRegister() { diff --git a/Source/Sharing/Private/SharingFunctions.cpp b/Source/Sharing/Private/SharingFunctions.cpp index 90cd3fb..02c10e9 100644 --- a/Source/Sharing/Private/SharingFunctions.cpp +++ b/Source/Sharing/Private/SharingFunctions.cpp @@ -4,6 +4,7 @@ // #include "SharingPrivatePCH.h" +#include "SharingFunctions.h" #if PLATFORM_IOS #import "IOSAppDelegate.h" @@ -33,7 +34,7 @@ void USharingFunctions::Share(FString EmailSubject, FString Message, FString Url TArray NewPixels; NewPixels.Reserve(Image.Pixels.Num() * 4); - for(int32 y = 0; y < Height; y++) + for(int32 y = Height-1; y >= 0; y--) { int32 PixelIndex = (Height - 1 - y) * Width; if (Image.Pixels.IsValidIndex(PixelIndex)) diff --git a/Source/Sharing/Sharing.Build.cs b/Source/Sharing/Sharing.Build.cs index e8d7080..db59ea0 100644 --- a/Source/Sharing/Sharing.Build.cs +++ b/Source/Sharing/Sharing.Build.cs @@ -3,11 +3,13 @@ // Copyright (c) 2015 Get Set Games Inc. All rights reserved. // +using System.IO; + namespace UnrealBuildTool.Rules { public class Sharing : ModuleRules { - public Sharing(TargetInfo Target) + public Sharing(ReadOnlyTargetRules Target) : base (Target) { PublicIncludePaths.AddRange( new string[] { diff --git a/sharing_BP_example.png b/sharing_BP_example.png new file mode 100644 index 0000000..4c92495 Binary files /dev/null and b/sharing_BP_example.png differ