Search found 1204 matches
- Wed Dec 18, 2024 8:17 am
- Forum: Support and Development
- Topic: How to change screenspace origin?
- Replies: 14
- Views: 2570
Re: How to change screenspace origin?
The zoom to mouse solution: https://love2d.org/forums/viewtopic.php?p=236724#p236724 Thanks for the link darkfrei! I like how you're using a power of two (that dscale factor) to make the zoom steps always exact, I hadn't thought of that before. Thanks! Your code looks much better! The idea with zoo...
- Mon Dec 16, 2024 8:05 am
- Forum: Support and Development
- Topic: How to change screenspace origin?
- Replies: 14
- Views: 2570
Re: How to change screenspace origin?
The zoom to mouse solution:
viewtopic.php?p=236724#p236724
viewtopic.php?p=236724#p236724
- Mon Dec 09, 2024 3:28 pm
- Forum: Support and Development
- Topic: Drawing grid resulting in offset tiles
- Replies: 2
- Views: 914
Re: Drawing grid resulting in offset tiles
Set the cols and rows instead of pixels, set the x and y of tiles by creating, just by multiplying with width+offsetX, height+offsetY.
- Tue Dec 03, 2024 3:40 pm
- Forum: Support and Development
- Topic: Help with making a button
- Replies: 9
- Views: 2044
Re: Help with making a button
This will be off by one pixel, though. Clicking exactly on the left or top border of the rectangle won't register the click; you need to be 1 pixel inside the left or top border for this to work. Yes, the better solution needs more logic: array of buttons, highlight the hovered button, select not a...
- Mon Dec 02, 2024 6:27 am
- Forum: Support and Development
- Topic: encrypted save
- Replies: 6
- Views: 1376
Re: encrypted save
Make the hash sum by the saving and recalculate it by the loading. If cheat, make the game harder and keep the hash wrong.
- Fri Nov 29, 2024 11:21 am
- Forum: Support and Development
- Topic: Help with making a button
- Replies: 9
- Views: 2044
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.
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.
Code: Select all
if (mx > x) and (mx < x + w) and (my > y) and (my < y + h) then -- point is inside the box
- Fri Nov 22, 2024 3:53 pm
- Forum: Support and Development
- Topic: Creating an RTS strategy with Love2D?
- Replies: 3
- Views: 1164
Re: Creating an RTS strategy with Love2D?
Making a small RTS in Love2D is definitely doable, even if you’re new to scripting languages. Love2D is pretty lightweight and great for 2D games, so you can handle stuff like maps, units, and simple controls without too much hassle. Start with something small, like a map where units can move around...
- Mon Oct 28, 2024 9:45 am
- Forum: Support and Development
- Topic: Pausing game when turning off
- Replies: 7
- Views: 2112
Re: Pausing game when turning off
Make dt small again!
If dt > 1/20 then dt = 1/20 end
If dt > 1/20 then dt = 1/20 end
- Thu Oct 03, 2024 6:20 pm
- Forum: Libraries and Tools
- Topic: Parabola functions in Lua
- Replies: 12
- Views: 121047
Re: Parabola functions in Lua
This function calculates the intersection points between a parabola defined by its focus and directrix and an inclined line represented by the equation y=kx+m. Parameters: fx: The x-coordinate of the focus of the parabola. fy: The y-coordinate of the focus of the parabola. k: The slope of the inclin...
- Tue Sep 24, 2024 8:25 am
- Forum: Libraries and Tools
- Topic: Simple Sprite Generator
- Replies: 18
- Views: 38208
Re: Simple Sprite Generator
Sorry to necro but I just stumbled upon this and found it really interesting, so I spent a few minutes porting it over to Love 11.5 from 0.9.1. It mostly trivial, just changing some constants and what not. As it stands, the Blur shader doesn't work as trying to use it just crashes. It has something...