Jump to content

Text shows up as black boxes


Max_M
 Share

Recommended Posts

Whenever I try to display text on the screen, it shows black boxes instead of text.

For example, when you win, this code executes:

 

local font = Font:Load("Fonts/arial.ttf", 48)
context:SetFont(font)
context:DrawText("YOU WIN!", context:GetWidth()/2, context:GetHeight()/2)

 

But the text "YOU WIN!" shows up black boxes on the screen instead of letters.

Link to comment
Share on other sites

Set it to alpha first then back to solid after:

 

context:SetBlendMode(Blend.Alpha)

local font = Font:Load("Fonts/arial.ttf", 48)

context:SetFont(font)

context:DrawText("YOU WIN!", context:GetWidth()/2, context:GetHeight()/2)

context:SetBlendMode(Blend.Solid)

---

Scott

 

Using Windows 7 Ultimate 64 bit/Core I7-2700K @ 4312mhz/24G RAM/Nvidia GTX 1060

Link to comment
Share on other sites

Set it to alpha first then back to solid after:

 

context:SetBlendMode(Blend.Alpha)

local font = Font:Load("Fonts/arial.ttf", 48)

context:SetFont(font)

context:DrawText("YOU WIN!", context:GetWidth()/2, context:GetHeight()/2)

context:SetBlendMode(Blend.Solid)

When I try that, the text doesn't show up at all.

Link to comment
Share on other sites

When I try that, the text doesn't show up at all.

 

Shows fine for me in white text. Maybe you need to set the color first.

 

context:SetColor(1,0,0,1)

---

Scott

 

Using Windows 7 Ultimate 64 bit/Core I7-2700K @ 4312mhz/24G RAM/Nvidia GTX 1060

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