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"

Texture2D Transparent

So, I'm trying to make a menu that has a left panel with a slightly transparent background, at the moment, I'm attempting to draw a background and I'm unable to make this transparent, I made a black image, with 80% opacity imported as a TGA and stored it in a Texture2D pointer(Texture2D*) All this is in the DrawHUD() override function at the moment.

     Super::DrawHUD();
     float WidthPercentage = 25.0f;
     float HeightPercentage = 100.0f;
 
     const FVector2D Center(0, 0);
     const FVector2D Position(0, 0);
     FVector2D ScaleSize(Canvas->ClipX * (WidthPercentage / 100.0f), Canvas->ClipY * (HeightPercentage / 100.0f));
     FCanvasTileItem TileItem(Position, LeftPanel->Resource, FLinearColor::White);
     TileItem.Size = ScaleSize;
     Canvas->DrawItem(TileItem);

So yeah, all I want is a a slightly transparent background for a panel on my game screen.

Thanks in advance!

Product Version: Not Selected
Tags:
more ▼

asked Mar 30 '14 at 12:41 PM in C++ Programming

avatar image

HenryH
211 11 16 97

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Worked it out, I used FLinearColor(1.0f, 1.0f, 1.0f, 0.8f) instead of FLinearColor::White and I set TileItem.BlendMode = SE_BLEND_TRANSLUCENT

more ▼

answered Mar 31 '14 at 08:30 AM

avatar image

HenryH
211 11 16 97

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
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