x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

GetScreenColorXY not giving color result, just black, BUG?

Hi there, i'm using UColorsBlueprintFunctionLibrary::GetScreenColorXY, compiling it without problem and adding a 2d vector from blueprint to move the pixels coordinates to be able to read pixel colors. It will allways give me black pixel color as a result. (though alpha is allways 1)

Any idea? Is it a bug? I'm not able to find or to think about any reason for this.

Here i copy my code and a screenshot of my blueprint.

In my build.css:

     PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "ApplicationCore" });

In my .h:

 #include "CoreMinimal.h"
  #include "Kismet/BlueprintFunctionLibrary.h"
  #include "ColorsBlueprintFunctionLibrary.generated.h"

         UFUNCTION(BlueprintCallable, Category = "Colors")
         static FLinearColor GetScreenColorXY(FVector2D InScreenPos, float InGamma);

In my cpp:

 #include "GenericPlatformApplicationMisc.h"

 FLinearColor UColorsBlueprintFunctionLibrary::GetScreenColorXY(FVector2D InScreenPos, float InGamma)
 {
     return FGenericPlatformApplicationMisc::GetScreenPixelColor(InScreenPos, InGamma);

And finaly in my blueprint i'm trying to use the function "Get Screen Color XY" in construction scritp

alt text

Debug on editor (in the picture i changed the name of the values, not a mistake there)

alt text

Product Version: UE 4.18
Tags:
blueprintdebug.jpg (195.8 kB)
coloranalisys.jpg (106.2 kB)
more ▼

asked Jun 08 '18 at 02:53 AM in C++ Programming

avatar image

dogrush
138 4 121 15

(comments are locked)
10|2000 characters needed characters left

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question