[FIXED] See posts below
Hi, I have a problem trying to make a blueprint function library.
My case is the following. I created a scroll box using UMG in the editor and I trying to use the GamePad. this is the set up:
&stc=1All seems fine but I not see any “Get” related with the position of the scroll. I see a node that go to the end of the scroll so I suppose the engine have some way for calculate the last scroll position. If I can’t know this position/offset when I scroll down my variable “scroll offset” can go to infinite… and so when I try to scroll up , the scroll bar not move until the scroll value is = to the end of the scroll value.
So I try to made a blueprint function library to have some “Get’s” that I miss available on blueprints.
I must say , I have some programing background , Python , javascript , php but 0 Experience in c++
I Start watching c++ tutorials, reading the Rama tutorials about the blueprint Functions Libraries etc… and well now I’m more familiar with the language I know about the :: for indicate the function is inside a calss, some about pointers ( not to match clear to me for now), what is .h and .cpp etc…
I so after that I try create my 1 blueprint function library and this is what I have
.h
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "Kismet/BlueprintFunctionLibrary.h"
#include "MyBP_Functions_library.generated.h"
/**
*
*/
UCLASS()
class MYFUNCTIONSLIBRARY_API UMyBP_Functions_library : public UBlueprintFunctionLibrary
{
GENERATED_BODY()
public:
UFUNCTION(BlueprintCallable, Category = "MyBPLibrary")
static FString GetHappyMessage();
UFUNCTION(BlueprintCallable, Category = "MyBPLibrary")
static float GetMyFloat();
};
.cpp
// Fill out your copyright notice in the Description page of Project Settings.
#include "MyFunctionsLibrary.h"
#include "MyBP_Functions_library.h"
//Happy Message
FString UMyBP_Functions_library::GetHappyMessage()
{
return FString("Victory! Victory BP Library Works!");
}
float UMyBP_Functions_library::GetMyFloat()
{
float MyFloat;
//float MyFloat = 0.5;
//this->GetScrollOffset()
//MyFloat = SScrollBox::GetScrollOffset();
//MyFloat -> SScrollBox::GetScrollOffset();
return MyFloat;
}
As you can see , returning a float and a string is fine , but I have no idea how get the value of the scroll or for the max scroll…
I find this on the wiki:
Can someone point me to what I need to learn to get this value from other class in other function, or some example to see? or say me what I’m doing wrong and the correct way to do it ? , I’m getting crazy …
(I try to understand some stuff on victory plugin from Rama but no luck, any specific part to see on this plugin?)
Thanks in advance
Greetings!