Maybe turn those into getMiddle() function?
Search found 85 matches
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...
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.
Re: 9Patch
Ok, thanks
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 ...
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?
Are there any other libraries or how to write own with quads?
- 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...
- 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
What about vice versa? Divide these by dimensions?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.
- Mon Jun 26, 2023 5:03 pm
- Forum: General
- Topic: How to get the size of the image knowing the scale given to it when drawing
- Replies: 4
- Views: 717