If the things you're trying to scale are static perhaps using love.graphics.newScreenshot could be an option. But you definitely don't want to be calling that every frame.
EDIT: On 2nd thought that's probably stupid.
Scaling love.graphics geometric shapes like bitmap pics?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Scaling love.graphics geometric shapes like bitmap pics?
Thought of this too, but decided not to post it as it's pretty bad advice, haha. Theoretically though, it gets the job done!veethree wrote:If the things you're trying to scale are static perhaps using love.graphics.newScreenshot could be an option. But you definitely don't want to be calling that every frame.
EDIT: On 2nd thought that's probably stupid.
Do you recognise when the world won't stop for you? Or when the days don't care what you've got to do? When the weight's too tough to lift up, what do you? Don't let them choose for you, that's on you.
- Daniel Eakins
- Citizen
- Posts: 99
- Joined: Thu Jul 18, 2013 9:14 pm
- Location: France
Re: Scaling love.graphics geometric shapes like bitmap pics?
I guess I'll try to use pre-rendered images when possible, and ImageData otherwise. Thanks for the replies!
Re: Scaling love.graphics geometric shapes like bitmap pics?
Alternatively, make a sprite of a line and scale and rotate it to match desired begin and end position. To get similar pixelation for short and long lines you could make a long line sprite and only draw a part of it that is sized relative to the length of the desired line segment.
Hope you paid attention in trig :op
That gives no perf overhead but will pixelate (if set to point filtering that is)
Hope you paid attention in trig :op
That gives no perf overhead but will pixelate (if set to point filtering that is)
- Daniel Eakins
- Citizen
- Posts: 99
- Joined: Thu Jul 18, 2013 9:14 pm
- Location: France
Re: Scaling love.graphics geometric shapes like bitmap pics?
With a pre-rendered image of a horizontal (or whatever) line? This doesn't work; love.graphics.rotate doesn't pixellate (result is similar to the white line in the first post).bizziboi wrote:Alternatively, make a sprite of a line and scale and rotate it to match desired begin and end position. To get similar pixelation for short and long lines you could make a long line sprite and only draw a part of it that is sized relative to the length of the desired line segment.
Hope you paid attention in trig p
That gives no perf overhead but will pixelate (if set to point filtering that is)
Re: Scaling love.graphics geometric shapes like bitmap pics?
Use a custom line function
here is an example using https://github.com/kikito/bresenham.lua
here is an example using https://github.com/kikito/bresenham.lua
- Attachments
-
- example2.love
- (2.47 KiB) Downloaded 75 times
- Daniel Eakins
- Citizen
- Posts: 99
- Joined: Thu Jul 18, 2013 9:14 pm
- Location: France
Re: Scaling love.graphics geometric shapes like bitmap pics?
Wow, thanks! That's perfect. I'm really amazed by what LÖVE is capable ofZeliarden wrote:Use a custom line function
here is an example using https://github.com/kikito/bresenham.lua
Re: Scaling love.graphics geometric shapes like bitmap pics?
Fixed that for youDaniel Eakins wrote: Wow, thanks! That's perfect. I'm really amazed by what kikito is capable of
Do you recognise when the world won't stop for you? Or when the days don't care what you've got to do? When the weight's too tough to lift up, what do you? Don't let them choose for you, that's on you.
Re: Scaling love.graphics geometric shapes like bitmap pics?
You already have a solution, but I still think this would have worked - you'd use a lower res texture for the line image and scale it up with point filtering - that would have given you larger pixels.With a pre-rendered image of a horizontal (or whatever) line? This doesn't work; love.graphics.rotate doesn't pixellate (result is similar to the white line in the first post).
- DaedalusYoung
- Party member
- Posts: 413
- Joined: Sun Jul 14, 2013 8:04 pm
Re: Scaling love.graphics geometric shapes like bitmap pics?
Yes, but you can't rotate that image, so you would either need Megabytes full of prerendered shapes, or generate the image on the fly.
Who is online
Users browsing this forum: Bing [Bot], Google [Bot] and 6 guests