Search found 2570 matches

by pgimeno
Mon Apr 19, 2021 7:40 pm
Forum: Support and Development
Topic: I'm about to make my own keyboard layout maps
Replies: 3
Views: 62

Re: I'm about to make my own keyboard layout maps

What I'm currently doing is use keypressed/keyreleased for all non-character keys. This works flawlessly. And textinput + setKeyRepeat for everything else - the first char of the text is my key and it is considered pressed until the emulated system is done polling the keyboard once. That works well...
by pgimeno
Mon Apr 19, 2021 7:07 pm
Forum: Support and Development
Topic: Efficiently drawing a grid map
Replies: 16
Views: 346

Re: Efficiently drawing a grid map

I thought sprite batching became automatic in Love a few versions ago? Am I mistaken about what that meant? I mention that later on. https://love2d.org/forums/viewtopic.php?p=240186#p240186 Manual batching is still available. As I mention in that post, I'm not sure whether it improves performance o...
by pgimeno
Mon Apr 19, 2021 6:28 pm
Forum: Support and Development
Topic: I'm about to make my own keyboard layout maps
Replies: 3
Views: 62

Re: I'm about to make my own keyboard layout maps

Whew, have you peeked down that rabbit hole and noticed its depth? Android does not generate accurate key down/up events. I don't remember the details but I think it generated both at the same time, or did not generate one of them, or something like that. IIRC it also generated textinput before keyp...
by pgimeno
Mon Apr 19, 2021 5:07 pm
Forum: Support and Development
Topic: String to access nested table value.
Replies: 4
Views: 62

Re: String to access nested table value.

There isn't a direct route. At best, you can make a function to do this kind of access, but it's not the path I'd recommend to follow: local function nested(table, index) for s in index:gmatch("[^%.]+") do table = table[s] end return table end local t = {x=0, y=5, other={z=10}} local zprop...
by pgimeno
Sun Apr 18, 2021 6:24 pm
Forum: Support and Development
Topic: Efficiently drawing a grid map
Replies: 16
Views: 346

Re: Efficiently drawing a grid map

No idea of how your project is structured. But you mentioned a grid, so I imagine that the images to draw in that grid are all of the same size. Create an image whose sides are multiples of the horizontal and vertical size respectively, of the images to include, that is able to fit all the images. T...
by pgimeno
Sun Apr 18, 2021 12:07 pm
Forum: General
Topic: My Function isn't activating, please help
Replies: 2
Views: 105

Re: My Function isn't activating, please help

I am trying to make a flappy bird replica but my "createrec" function does not seem to work... It is very possible that it is a different problem because as my name suggests, I am very bad. This is the code: function love.load() love.physics.setMeter(64) world = love.physics.newWorld(0, 9...
by pgimeno
Sun Apr 18, 2021 11:56 am
Forum: Support and Development
Topic: Efficiently drawing a grid map
Replies: 16
Views: 346

Re: Efficiently drawing a grid map

You can certainly generate the atlas at load time, if that's what you're asking. Even a canvas would work.
by pgimeno
Sun Apr 18, 2021 2:19 am
Forum: Support and Development
Topic: Efficiently drawing a grid map
Replies: 16
Views: 346

Re: Efficiently drawing a grid map

If you had a dungeon crawler that doesn't scroll very fast, would it help to draw all the floor tiles first then all the walls then all the doors etc? In other words, don't blindly draw left to right and causing a lot of swapping? If you have all floor tiles in a single texture atlas, all the walls...
by pgimeno
Sat Apr 17, 2021 5:47 pm
Forum: Support and Development
Topic: Efficiently drawing a grid map
Replies: 16
Views: 346

Re: Efficiently drawing a grid map

I'm not hitting a bottleneck, just done with the map, so now I'm thinking on optimization... Planning on using a texture atlas in advance would have saved you some work. Don't believe the tale about "premature optimization blah blah". Misuse of that adage is the root of all evil. 1)So wil...
by pgimeno
Sat Apr 17, 2021 11:38 am
Forum: Support and Development
Topic: Efficiently drawing a grid map
Replies: 16
Views: 346

Re: Efficiently drawing a grid map

A texture atlas is the way to speed it up. SpriteBatch is made mostly for this kind of usage, and requires a texture atlas. Thnx, now I know it's possible, but how? 1)Any pointers/references on the use for this type of thing? 2) Will it make the game faster? 1) https://love2d.org/wiki/Tutorial:Effi...