Search found 16 matches

by DGM
Sat Aug 27, 2022 2:09 pm
Forum: Support and Development
Topic: How do I target the newQuad() function?
Replies: 4
Views: 2278

Re: How do I target the newQuad() function?

darkfrei wrote: Wed Aug 24, 2022 7:52 am
local quad = love.graphics.newQuad ( x, y, w, h, image )
That's what I was missing. For some reason I was assuming that only the version of a function at the top of the page was legit and the lower ones were obsolete. Not sure why. But it caused me to miss that.

Thanks.
by DGM
Wed Aug 24, 2022 7:27 am
Forum: Support and Development
Topic: How do I target the newQuad() function?
Replies: 4
Views: 2278

How do I target the newQuad() function?

Hi, I'm trying to load a large .png image and draw only part of it to a canvas. My understanding is that I should use a quad to lift part of the image and then draw that, but I'm not seeing how to aim the newQuad() function. It's arguments don't include an image/texture/whatever argument and I don't...
by DGM
Wed Jan 23, 2019 5:28 am
Forum: Support and Development
Topic: [SOLVED] Drawing on canvas works wrong
Replies: 7
Views: 7510

Re: [SOLVED] Drawing on canvas works wrong

Thanks, I've changed the text to mention that. Anything else I should know?
by DGM
Tue Jan 22, 2019 11:03 pm
Forum: Support and Development
Topic: [SOLVED] Drawing on canvas works wrong
Replies: 7
Views: 7510

Re: [SOLVED] Drawing on canvas works wrong

You get one free clear at the start of the draw loop as love clears the screen for you ready to draw the new frame. But the free clear applies only to the screen and not to the canvases, correct? That makes sense. As for the tint, yes it applies to everything drawn. You can use this to your advanta...
by DGM
Tue Jan 22, 2019 2:23 am
Forum: Support and Development
Topic: [SOLVED] Drawing on canvas works wrong
Replies: 7
Views: 7510

Re: [SOLVED] Drawing on canvas works wrong

That fixed it, thanks. But why is the last clear unnecessary? I get that I don't need it here since the image doesn't change, but aren't I normally supposed to clear the screen between frames? EDIT: One more question. Does the tint apply to everything drawn with the graphics.draw() function? I just ...
by DGM
Tue Jan 22, 2019 2:04 am
Forum: Support and Development
Topic: [SOLVED] Drawing on canvas works wrong
Replies: 7
Views: 7510

[SOLVED] Drawing on canvas works wrong

Hello again, More trouble with canvases. Again, this is with v11.2 on 64-bit Windows 10. I'm attempting to draw a white square with a smaller blue square inside of it to a canvas, then draw the result to the screen. Instead what I get is a solid blue square with no hint of white. Here's the full cod...
by DGM
Sun Jan 20, 2019 11:02 pm
Forum: Support and Development
Topic: [SOLVED] Canvas is crashing 11.2
Replies: 3
Views: 4013

Re: Canvas is crashing 11.2

When love.draw finishes, you need to have no canvas active, so you need to disable it at some point before the end of love.draw(). This works, for example: That was the problem. Thanks. Suggestion to the Love2D devs: a warning about needing to deactivate your canvases in the documentation for the c...
by DGM
Sun Jan 20, 2019 10:27 pm
Forum: Support and Development
Topic: [SOLVED] Canvas is crashing 11.2
Replies: 3
Views: 4013

[SOLVED] Canvas is crashing 11.2

Hello, I'm using v11.2 in 64-bit Windows 10. Trying to use a canvas causes an immediate crash, even with the following minimal code: function love.load() canvas_1 = love.graphics.newCanvas() end function love.update() end function love.draw() love.graphics.setCanvas(canvas_1) end Here's the error me...
by DGM
Fri Nov 02, 2018 12:05 am
Forum: Support and Development
Topic: [SOLVED] Detecting special characters with love.textinput()
Replies: 3
Views: 3435

[SOLVED] Detecting special characters with love.textinput()

Hello, I'm trying to make a simple command-line interface by using the love.textinput(text) function (this is with Love2d version 11.1). I've got text appearing but I can't get the program to recognize when the return key is pressed. I know I can do this with love.keypressed(key) by comparing key to...