Search found 85 matches

by notcl4y
Fri Jun 30, 2023 6:45 am
Forum: General
Topic: 9Patch
Replies: 13
Views: 2692

Re: 9Patch

darkfrei wrote: Fri Jun 30, 2023 4:55 am where are you calculates new middleW and middleH after rescaling?
Maybe turn those into getMiddle() function?
by notcl4y
Thu Jun 29, 2023 6:47 pm
Forum: General
Topic: 9Patch
Replies: 13
Views: 2692

Re: 9Patch

Here :o: local lib = {} function lib.load(filename, edgeW, edgeH) local image = love.graphics.newImage(filename) local imageW, imageH = image:getDimensions() local middleW, middleH = imageW - 2*edgeW, imageH - 2*edgeH -- quads: -- 1 2 3 -- 4 5 6 -- 7 8 9 local quad1 = love.graphics.newQuad(0,0, edge...
by notcl4y
Thu Jun 29, 2023 6:46 pm
Forum: General
Topic: 9Patch
Replies: 13
Views: 2692

Re: 9Patch

Looks like I'll have to send the library code again because I couldn't figure everything in your code out to fit mine. :o:
by notcl4y
Thu Jun 29, 2023 6:25 pm
Forum: General
Topic: 9Patch
Replies: 13
Views: 2692

Re: 9Patch

Ok, thanks
by notcl4y
Thu Jun 29, 2023 3:04 pm
Forum: General
Topic: 9Patch
Replies: 13
Views: 2692

Re: 9Patch

darkfrei wrote: Tue Jun 27, 2023 8:47 pm (not tested)
Just tested it, it works the same as the way I tried to write. Of course I've changed something in your code to fit with mine. But still either the quads are broken, they work the different way or we wrote it the wrong way.
Screenshot_2.png
Screenshot_2.png (6.65 KiB) Viewed 1535 times
by notcl4y
Wed Jun 28, 2023 7:02 am
Forum: General
Topic: 9Patch
Replies: 13
Views: 2692

Re: 9Patch

What 9patch libraries are there? I know there's patchy and slicy (the fixed version of patchy). But they work different. You need to place pixels in the borders of the image. Are there any other libraries or how to write own with quads? local function newQuadPatch (image, edgeW, edgeH, x, y) local ...
by notcl4y
Tue Jun 27, 2023 7:13 am
Forum: General
Topic: 9Patch
Replies: 13
Views: 2692

9Patch

What 9patch libraries are there? I know there's patchy and slicy (the fixed version of patchy). But they work different. You need to place pixels in the borders of the image.

Are there any other libraries or how to write own with quads?
by notcl4y
Mon Jun 26, 2023 5:54 pm
Forum: General
Topic: How to get the size of the image knowing the scale given to it when drawing
Replies: 4
Views: 717

Re: How to get the size of the image knowing the scale given to it when drawing

If you know the scaling factor used to scale up the images while drawing, then you just divide the dimensions by the scaling factor, yeah. Of course, that assumes that you know the resulting drawn dimensions of the image. This is because getDimensions returns the dimensions of the texture, it won't...
by notcl4y
Mon Jun 26, 2023 5:16 pm
Forum: General
Topic: How to get the size of the image knowing the scale given to it when drawing
Replies: 4
Views: 717

Re: How to get the size of the image knowing the scale given to it when drawing

MrFariator wrote: Mon Jun 26, 2023 5:07 pm If you have an image, you can get its dimensions with getDimensions. Multiply these by your scaling factor.
What about vice versa? Divide these by dimensions?