Page 1 of 1

How do you draw text on top of a rectangle that is already drawn?

Posted: Sun Apr 02, 2017 2:47 am
by edgemaster1
I want to make little tooltips on this little interactive thing i'm making that is informative on historic events.
So, what I did was that I created a background image, added little areas that when your mouse hovers over them, draws a rectangle and is supposed to draw text over that rectangle. But that doesn't happen for some reason. oddly, I can draw another rectangle over that rectangle, but I can't draw text.

Can someone explain why this is the case and how to fix this?

Re: How do you draw text on top of a rectangle that is already drawn?

Posted: Sun Apr 02, 2017 4:25 am
by Jasoco
First, you packaged the .love file wrong. You need to zip the contents, not the folder.

Second, you forgot to set the color of the text so it's drawing in the same color as the rectangle, as far as I can tell without actually having to unpackage it and package it correctly myself.

Re: How do you draw text on top of a rectangle that is already drawn?

Posted: Sun Apr 02, 2017 4:31 am
by mtdev
Think you are rotating the text off the screen.

Just give it the x and y

Code: Select all

love.graphics.draw(slide_1_caption, 928,145)
:P