Jump to content

Menu buttons make wordwrap text vanish.


Herobot
 Share

Recommended Posts

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 comment
Share on other sites

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.

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

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 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
Reply to this topic...

×   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.

 Share

×
×
  • Create New...