Search found 231 matches

by Luke100000
Thu Oct 31, 2019 5:22 pm
Forum: Support and Development
Topic: Independent Particle Colors
Replies: 11
Views: 2371

Re: Independent Particle Colors

Why dont you just make a table that holds all the confetti particles, update all of them for things like movement of the confetti particles and then draw all of them using a SpriteBatch, setting thier individual colors with SpriteBatch:setColor( r, g, b, a )? You mean something like creating a tabl...
by Luke100000
Thu Oct 31, 2019 5:12 pm
Forum: General
Topic: how to make text clickable like a button
Replies: 2
Views: 973

Re: how to make text clickable like a button

and if you want the bounding box adapt to your text, use
width = Font:getWidth( text ) to get the texts width
height = Font:getHeight( ) to get its height
love.graphics.getFont() to get the current font
by Luke100000
Mon Oct 28, 2019 6:45 pm
Forum: Support and Development
Topic: Independent Particle Colors
Replies: 11
Views: 2371

Re: Independent Particle Colors

Sadly, so far I know there is no setColor function for particle systems. If the particle system is simple you could use a spritebatch instead. Ah that's a shame. Then I have two options. Would it be more efficient to create a new particle system for every color I want or new sprites? New sprites. T...
by Luke100000
Mon Oct 28, 2019 7:07 am
Forum: Support and Development
Topic: Independent Particle Colors
Replies: 11
Views: 2371

Re: Independent Particle Colors

You could use an atlas with several colored stars, then supply the quads with particleSystem:setQuads(). I could. I was just hoping to have the color be set by love2d. I'd prefer not to make whole new assets if I forget a color or something. Sadly, so far I know there is no setColor function for pa...
by Luke100000
Sun Oct 27, 2019 11:50 am
Forum: Support and Development
Topic: Independent Particle Colors
Replies: 11
Views: 2371

Re: Independent Particle Colors

You could use an atlas with several colored stars, then supply the quads with particleSystem:setQuads().
by Luke100000
Thu Oct 24, 2019 10:54 am
Forum: Support and Development
Topic: attempt to index local 'game' (a nil value)
Replies: 4
Views: 858

Re: attempt to index local 'game' (a nil value)

So we need the full code, at least the lines from where you call the update function.

Also you do not need extra parentheses for the if statements in lua :)
by Luke100000
Thu Oct 24, 2019 10:48 am
Forum: Support and Development
Topic: High CPU consumption
Replies: 7
Views: 1014

Re: High CPU consumption

As raidho34 said, I just limited the x and y loop. Usually drawing outside the screen (images) won't really affect the performance, this is already handled by the GPU (or something before, I'm not sure). But text requires some pre processing. So don't check every image manually. Limit mass draws lik...
by Luke100000
Mon Oct 21, 2019 12:16 pm
Forum: General
Topic: How much objects can Love2d display at one time?
Replies: 4
Views: 2101

Re: How much objects can Love2d display at one time?

Well, depends on CPU and GPU. The best way, if the tiles are small, is to use canvases. Render it once, then draw the entire canvas. This way there is no real limit. If your tiles are animated or too big, use a spritebatch and a texture atlas. Or use both, for example when zooming in, use the sprite...
by Luke100000
Mon Oct 21, 2019 12:09 pm
Forum: General
Topic: love2d without window
Replies: 1
Views: 1175

Re: love2d without window

Works fine for me. Windows 10, LÖVE 11.2.
Do you have any error messages?
by Luke100000
Mon Oct 21, 2019 12:02 pm
Forum: Support and Development
Topic: High CPU consumption
Replies: 7
Views: 1014

Re: High CPU consumption

I assume that the CPU usage is only from preparing the text, not rendering. So, as pgimeno said, a text object should fix that. (not tested yet)

If this is not possible, then at least only draw text visible on screen. I tested this and achieved 4% CPU usage instead of 25%.