Jump to content
Leadwerks Community

Recommended Posts

Posted

I have the below in a script in a scene and it does not draw a rounded rectangle. It makes a line at the top of the rect to the top left of the screen.

 

function Script:PostRender(context)
   context:SetBlendMode(Blend.Alpha)
   context:SetColor(Vec4(1))
   context:DrawRect(100, 100, 100, 100, 0, 2)
end

  • Upvote 1
Posted

Agree. Either applying the gradient or adding a radius will draw the rectangle incorrectly.

window=Window:Create("example",0,0,600,400,window.Titlebar+window.Center)

context=Context:Create(window,4)

world=World:Create()

camera = Camera:Create()

 

while window:KeyDown(Key.Escape)==false do

if window:Closed() then break end

Time:Update()

world:Update()

world:Render()

 

context:SetBlendMode(Blend.Alpha)

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

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

 

context:DrawRect(100,100,400,200,0,5)

context:SetGradientMode(true)

context:SetBlendMode(Blend.Solid)

 

context:Sync(true)

end

post-14-0-18163300-1481989965.jpg

 

And if doing gradient only:

post-14-0-70821600-1481989998.jpg

  • Upvote 1

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

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.

×
×
  • Create New...