Search found 3671 matches
- Fri Dec 13, 2024 10:41 am
- Forum: Support and Development
- Topic: How to change screenspace origin?
- Replies: 14
- Views: 2507
Re: How to change screenspace origin?
I think RNavega's suggestion of using a transform object was good, it just missed a little detail. This zooms around the centre of the screen, assuming centreX, centreY are set to love.graphics.getWidth()/2 and love.graphics.getHeight()/2 respectively: zoomTF:setTransformation(centreX, centreY, 0, z...
- Tue Dec 03, 2024 5:43 pm
- Forum: Support and Development
- Topic: Help with making a button
- Replies: 9
- Views: 2021
Re: Help with making a button
I was just pointing in the direction that the check for the left and top corners should use >= instead of > to avoid that problem.
- Tue Dec 03, 2024 11:39 am
- Forum: Support and Development
- Topic: Help with making a button
- Replies: 9
- Views: 2021
Re: Help with making a button
Simple version: The button has top left corner in x, y and width, height w, h. On the click check if the mouse position mx, my is inside the rectangle of button. if (mx > x) and (mx < x + w) and (my > y) and (my < y + h) then -- point is inside the box This will be off by one pixel, though. Clickin...
- Tue Dec 03, 2024 11:26 am
- Forum: Support and Development
- Topic: Spawning items/checking collision
- Replies: 4
- Views: 1355
Re: Spawning items/checking collision
Edit: I also wonder if such a loop would go forever (on my phone now, can't test it): for a, b in ipairs( myTable ) do table.insert( myTable, item ) end ... would ipairs() keep iterating forever, since the list is constantly growing in its array part? It does, I tested it. I tried adding glue code ...
- Mon Dec 02, 2024 8:40 pm
- Forum: Support and Development
- Topic: Spawning items/checking collision
- Replies: 4
- Views: 1355
Re: Spawning items/checking collision
Can you give a working example exhibiting the problem? The code you've shown doesn't work at all.
- Mon Dec 02, 2024 12:58 pm
- Forum: Support and Development
- Topic: Quad getPixel() or getPixels() not possible ?
- Replies: 2
- Views: 985
Re: Quad getPixel() or getPixels() not possible ?
A quad is just a rectangle, so to say; it does not contain the image data itself, and you're right, ImageData does not support quads. But you can simulate it easily with Quad:getViewport : local function getQuadPixel(imgData, quad, x, y) local x0, y0 = quad:getViewport() return imgData:getPixel(x - ...
- Wed Nov 27, 2024 9:53 pm
- Forum: Support and Development
- Topic: Need help to animation
- Replies: 1
- Views: 865
Re: Need help to animation
The problem might be the quotes around "1". Use love.mouse.isDown(1) instead of love.mouse.isDown("1"). Also, if you want people with other keyboards to be able to use your game, use love.keyboard.isScancodeDown instead of love.keyboard.isDown, specifying WASD instead of ZQSD. Th...
- Sun Nov 24, 2024 8:58 am
- Forum: Support and Development
- Topic: my video wont play at all and i dont know what to do
- Replies: 4
- Views: 1693
Re: my video wont play at all and i dont know what to do
The error is due to missing quotes around the file name, "Cowbelly.ogv".
- Sat Nov 23, 2024 10:26 pm
- Forum: Support and Development
- Topic: anim8
- Replies: 4
- Views: 1343
Re: anim8
The problem is that you used player.spritesheet.getWidth() (with a period) instead of player.spritesheet:getWidth() (with a colon). To understand why you get that message, you have to know that when using a colon, the object before the colon (in this case player.spritesheet) is passed as an implicit...
- Sat Nov 23, 2024 10:14 pm
- Forum: Games and Creations
- Topic: Hotplate app for your phone
- Replies: 19
- Views: 14163
Re: Hotplate app for your phone
I'm not sure how come this useful app was not ported to 11.x before, but I've taken on that task and here it is.