Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions Source/Sharing/Classes/ScreenshotComponent.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

#pragma once

#include "Components/ActorComponent.h"
#include "ScreenshotComponent.generated.h"

USTRUCT(BlueprintType)
Expand Down
1 change: 1 addition & 0 deletions Source/Sharing/Classes/SharingComponent.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

#pragma once

#include "Components/ActorComponent.h"
#include "SharingComponent.generated.h"

UCLASS(ClassGroup=Sharing, HideCategories=(Activation, "Components|Activation", Collision), meta=(BlueprintSpawnableComponent))
Expand Down
3 changes: 3 additions & 0 deletions Source/Sharing/Classes/SharingFunctions.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@

#pragma once

#include "UObject/Object.h"
#include "UObject/ScriptMacros.h"
#include "ScreenshotComponent.h"
#include "SharingFunctions.generated.h"

UCLASS(NotBlueprintable)
Expand Down
1 change: 1 addition & 0 deletions Source/Sharing/Private/ScreenshotComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
//

#include "SharingPrivatePCH.h"
#include "ScreenshotComponent.h"

void UScreenshotComponent::OnRegister()
{
Expand Down
1 change: 1 addition & 0 deletions Source/Sharing/Private/SharingComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
//

#include "SharingPrivatePCH.h"
#include "SharingComponent.h"

void USharingComponent::OnRegister()
{
Expand Down
3 changes: 2 additions & 1 deletion Source/Sharing/Private/SharingFunctions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
//

#include "SharingPrivatePCH.h"
#include "SharingFunctions.h"

#if PLATFORM_IOS
#import "IOSAppDelegate.h"
Expand Down Expand Up @@ -33,7 +34,7 @@ void USharingFunctions::Share(FString EmailSubject, FString Message, FString Url
TArray<uint8> 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))
Expand Down
4 changes: 3 additions & 1 deletion Source/Sharing/Sharing.Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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[] {
Expand Down
Binary file added sharing_BP_example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.