How to scale extend width/height of border images without doubling the border thickness.

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
lavrod
Prole
Posts: 1
Joined: Mon Oct 09, 2017 1:09 pm

How to scale extend width/height of border images without doubling the border thickness.

Post by lavrod »

Hi,
How to scale extend width/height of border images without doubling the border thickness.

currently using love.graphics.setDefaultFilter("nearest","nearest",1)

For example I want to double the following image

111
101
111

to

1111
1001
1001
1111

not

111111
111111
110011
110011
111111
111111
Merlin_ua
Prole
Posts: 4
Joined: Fri Jun 21, 2013 7:34 am

Re: How to scale extend width/height of border images without doubling the border thickness.

Post by Merlin_ua »

The usual scaling methods don't discriminate edge pixels vs center pixels, so you won't be able to achieve what you want.

However, this looks like a problem for the 9-patch images. You can read about them here: http://wiresareobsolete.com/2010/06/9-patches/ There is a Love2d library that you might try: https://github.com/excessive/patchy
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot] and 47 guests