Jump to content

Drawtext in VR, what am I doing wrong?


qcrocknet
 Share

Recommended Posts

Hello,

First, I am very new to Leadwerks and very impressed with the functionnalities and quality of this engine. I bought the professional version mainly for VR purposes.

While experimenting with the VR demo project I wanted to have some text shown after I clicked the trigger button (added in the VRPlayer.lua), but nothing is showing. I used the same code in FPSPlayer and it does show. Am I doing something wrong?

if VR:GetControllerButtonHit(VR.Left + n, VR.TriggerButton)==true then
			context:SetFont(self.font)
			context:SetBlendMode(Blend.Alpha)
			context:SetColor(1,0.1,0.1)
			context:SetBlendMode(Blend.Alpha)
			context:DrawText("Test 1",160,70)
			local fh=self.font:GetHeight()
			context:DrawText(Test 2",(context:GetWidth()-self.font:GetTextWidth(text))/2,(context:GetHeight()-fh)/2-fh*1.5)
			context:SetBlendMode(Blend.Solid)
			......

I am using the Oculus Quest 2 with a link connection. I see the proper controller models and can pickup the blocks and teleport around.

Windows 10, latest NVIDIA drivers, latest Oculus drivers/app, latest SteamVR.

Thank you very much in advance.

Martin

  • Like 1
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...