Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
  • 0

Menu buttons make wordwrap text vanish.


Herobot

Question

I'm using the improved DrawText to show dialogue onscreen with wordwrap, but the text disappears when I interact with the buttons on the GUI menu. Simply mousing over a button makes the text disappear, and it stays gone until I click on an open section of the screen.

function Script:PostRender(context)
	context:DrawText(self.text, 10, 10, 300, 100, Text.WordWrap)
end

Using the regular DrawText command doesnt cause the text to vanish, but it doesnt have automatic wordwrap. Is there something I can change to keep the wordwrapped text from disappearing?

Link to post

3 answers to this question

Recommended Posts

  • 0
5 hours ago, Herobot said:

I'm using the improved DrawText to show dialogue onscreen with wordwrap, but the text disappears when I interact with the buttons on the GUI menu. Simply mousing over a button makes the text disappear, and it stays gone until I click on an open section of the screen.


function Script:PostRender(context)
	context:DrawText(self.text, 10, 10, 300, 100, Text.WordWrap)
end

Using the regular DrawText command doesnt cause the text to vanish, but it doesnt have automatic wordwrap. Is there something I can change to keep the wordwrapped text from disappearing?

I cannot tell what you are doing without a working example.

Link to post
  • 0
2 hours ago, Josh said:

I cannot tell what you are doing without a working example.

Made an example, open a blank project and attach this code to a pivot in an empty map.

function Script:PostRender(context)
	context:SetColor(1,1,1)
	context:SetBlendMode(Blend.Alpha)
	context:DrawText("This text starts invisible. Press escape and left click anywhere except a menu button to show it.", 10, 10, 300, 100, Text.WordWrap)
	--mousing over a menu button causes the above text to disappear again.
	context:SetColor(1,0,1)
	context:DrawText("Normal DrawText, always visible.", 10,150)
	context:SetBlendMode(Blend.Solid)
end

 

Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  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.

Facebook Twitter Youtube Github Steam
×
×
  • Create New...