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"

Is it possible to label components in the Editor?

Currently i am working with an visualizer module (link) to visualize my components. But i want to add additional information as Text in the World like it is possible in Unity (following picture) without adding components to the actor and only visible in editor view or debug view.

alt text

I think it is an essential thing during development to use, so there must be a way to easily archive this but i dont find any solutions for this in the web or engine. Can somebody please help me and give me some hints or a solution?

Please only C++ solutions.

Okay I found that the FComponentVisualizer class has a DrawVisualizationHUD(const UActorComponent* Component, const FViewport* Viewport, const FSceneView* View, FCanvas* Canvas) function. But I don't get how to use it. Does anyone please have an idea?

Product Version: UE 4.18
more ▼

asked Nov 13 '17 at 09:32 AM in C++ Programming

avatar image

1 2

avatar image mnikonov Sep 05 '18 at 03:34 PM

I have the same problem.

At first sight DrawVisualizationHUD() seems like the correct way of doing it.

But it does not work at all. No matter what you draw on the supplied Canvas, it never shows on screen. Flushing the canvas does not help.

Searching the internet returns zero examples of using DrawVisualizationHUD() to do anything at all. Searching Unreal Engine repository also does not help - the DrawVisualizationHUD() method is there, but never used in any visualisers.

avatar image mnikonov Sep 05 '18 at 04:01 PM

I should mention that DrawVisualizationHUD() does not work as of 4.19. Did not try 4.20 yet.

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

1 answer: sort voted first

Hi. Component visualizer works a bit different. It diplays only selected components as I know. If you want to draw something persistant to display your components you have to use a component render proxy (it responsible both for debug and realtime drawing. ) To find out how to do this you can see a Spline component code already existing in the engine. Actually you have to override CreateSceneProxy() function to create and return your own scene proxy that will draw anything you need.

more ▼

answered Nov 16 '17 at 12:46 AM

avatar image

1k 13 8 31

avatar image mnikonov Sep 05 '18 at 03:48 PM

This answer is not useful at all.

The question was about text labels in a component visualizer. It is a perfectly valid intention - sometimes you need to visualize something only in Blueprint editor viewport, but not in game, and you may need some text labels. Component visualizer is the correct place to do it.

Component scene proxy is used for rendering in game. But having debug rendering code in gameplay component may be undesirable for performance reasons or for code clarity reasons.

Besides, it is not clear how to render text labels via scene proxy (I wonder if it is possible at all?) For text labels, you usually need an FCanvas (or a HUD, that internally uses FCanvas). Functions like DrawDebugString() use a debug HUD connected to PlayerController, but it is available only in game, not in BP editor viewport.

(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