Jump to content

Add text to f3 debug screen.


Raycoms

Recommended Posts

Yeah i got to RenderGameOverlayEvent.Text.

But where do I get an instance of this object to add my text to it?

 

And do I have to add it to a particular class or may I add it to whatever class which gets called once per tick?

 

RenderGameOverlayEvent.Text

is an event, you need to subscribe to it with an event handler. Events and event handlers are explained here.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to comment
Share on other sites

I know how to add events, but the event object of RenderGameOverlayEvent.Text doesn't give me a world object or anything useful to operate on.

 

 

 @SubscribeEvent
    public void onDebugOverlay(RenderGameOverlayEvent.Text event)
    {
        event.getLeft().add("Colony in distance: ");
    }

Link to comment
Share on other sites

I tried to find out when it is the debug screen.

 

I tried the one under it but when I debugged it I noticed that there is no difference between debug and normal mode.

Only the lists are full in debug, but if our users use additional mods checking that won't work.

 

if(event.getType() == RenderGameOverlayEvent.ElementType.DEBUG)
        {
            event.getLeft().add("Colony in distance: ");
        }

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.