It would be an option, but not the perfect one as it would also squish the pixels in the line of the oval and rotating would distort it and cause breaks. It'd be better to have one that works properly.coffee wrote:Hmmm... Maybe use l.g.scale to distort circles to make them ovals?I wish we could draw ovals by way of extra parameters to the circle function. (X squish, Y squish and rotation)
roundrect: a fully functioning implementation
- Jasoco
- Inner party member
- Posts: 3725
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
- Contact:
Re: roundrect: a fully functioning implementation
Re: roundrect: a fully functioning implementation
Yeah, you right. The theory makes sense but in practical terms small circles overgrowth with exaggerated scale probably wouldn't be nice to look. Wouldn't be so good as the real deal. A native oval function or circle improvement as you suggested would be welcomed for sure.Jasoco wrote:It would be an option, but not the perfect one as it would also squish the pixels in the line of the oval and rotating would distort it and cause breaks. It'd be better to have one that works properly.coffee wrote:Hmmm... Maybe use l.g.scale to distort circles to make them ovals?I wish we could draw ovals by way of extra parameters to the circle function. (X squish, Y squish and rotation)
- trubblegum
- Party member
- Posts: 192
- Joined: Wed Feb 22, 2012 10:40 pm
Re: roundrect: a fully functioning implementation
Attachment does not exist
Re: roundrect: a fully functioning implementation
Gosh, you really skimmed my request post! That's why I'm heretrubblegum wrote:Attachment does not exist
- trubblegum
- Party member
- Posts: 192
- Joined: Wed Feb 22, 2012 10:40 pm
Re: roundrect: a fully functioning implementation
But I was skimming for a roundrect
Re: roundrect: a fully functioning implementation
a - If you don't mind a solid alpha solution just use for now my overlapping solution.trubblegum wrote:But I was skimming for a roundrect
b - For something capable of alpha you could try imaginee something using polygons that should be robin's solution. I suck at math.
c - I checked message in the bottle solution. Technocat uses scissors! Clever. I need to learn how to "scissor" then.
Code: Select all
function MessageBottle:drawBackground()
--draw background
--self.bgAlpha
--self.alpha
love.graphics.pushState()
local r,g,b,a = self.bgColor.r, self.bgColor.g, self.bgColor.b
local a = self.bgAlpha * self.alpha
local r = self.bgRadius
local x,y = self.x, self.y
local w,h = self.width, self.height
local segments = self.bgRadiusSegments
love.graphics.setColor(r,g,b,a)
--center rectangle
love.graphics.rectangle("fill",
x, y,
w, h)
--top border
love.graphics.rectangle("fill",
x, y-r,
w, r)
-- right border
love.graphics.rectangle("fill",
x+w, y,
r, h)
--bottom border
love.graphics.rectangle("fill",
x, y+h,
w, r)
--left border
love.graphics.rectangle("fill",
x-r, y,
r, h)
--top left corner
love.graphics.setScissor(
x-r, y-r,
r, r)
love.graphics.circle("fill",
x, y,
r, segments)
--top right corner
love.graphics.setScissor(
x+w, y-r,
r, r)
love.graphics.circle("fill",
x+w, y,
r, segments)
--bottom right corner
love.graphics.setScissor(
x+w, y+h,
r, r)
love.graphics.circle("fill",
x+w, y+h,
r, segments)
--bottom left corner
love.graphics.setScissor(
x-r, y+h,
r, r)
love.graphics.circle("fill",
x, y+h,
r, segments)
love.graphics.popState()
end
Re: roundrect: a fully functioning implementation
0.8.0 hasn't been released at all. Any binary out there is of in-development code. You can compile it yourself on Linux if you need to.coffee wrote:Remember (if I'm right) that Linux users haven't yet a 0.8 version
Who is online
Users browsing this forum: No registered users and 20 guests