Main Menu
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- baconhawka7x
- Party member
- Posts: 491
- Joined: Mon Nov 21, 2011 7:05 am
- Location: Oregon, USA
- Contact:
Main Menu
I've been making progress on my game. But i just need to know one thing. How do I make a button? sorry im a little new but all help is very appreciated!
- josefnpat
- Inner party member
- Posts: 955
- Joined: Wed Oct 05, 2011 1:36 am
- Location: your basement
- Contact:
Re: Main Menu
Well, you would draw the button, and if your love.mousepressed x's and y's are within the correct ranges, consider that the "button click" event.
Missing Sentinel Software | Twitter
FORCIBLY IGNORED.
<leafo> when in doubt delete all of your code
<bartbes> git rm -r *
<bartbes> git commit -m "Fixed all bugs"
<bartbes> git push
FORCIBLY IGNORED.
<leafo> when in doubt delete all of your code
<bartbes> git rm -r *
<bartbes> git commit -m "Fixed all bugs"
<bartbes> git push
- baconhawka7x
- Party member
- Posts: 491
- Joined: Mon Nov 21, 2011 7:05 am
- Location: Oregon, USA
- Contact:
Re: Main Menu
How would i do that? lol sorry..im not the best..josefnpat wrote:Well, you would draw the button, and if your love.mousepressed x's and y's are within the correct ranges, consider that the "button click" event.
- josefnpat
- Inner party member
- Posts: 955
- Joined: Wed Oct 05, 2011 1:36 am
- Location: your basement
- Contact:
Re: Main Menu
well, to draw the button you would use love.graphics.draw()baconhawka7x wrote:How would i do that? lol sorry..im not the best..josefnpat wrote:Well, you would draw the button, and if your love.mousepressed x's and y's are within the correct ranges, consider that the "button click" event.
then in the function love.mousepressed() you would have to say:
Code: Select all
if x > button.x and
x < button.x + button.img:width and
y > button.y and
y < button.y + button.img:height then
--button action
end
Missing Sentinel Software | Twitter
FORCIBLY IGNORED.
<leafo> when in doubt delete all of your code
<bartbes> git rm -r *
<bartbes> git commit -m "Fixed all bugs"
<bartbes> git push
FORCIBLY IGNORED.
<leafo> when in doubt delete all of your code
<bartbes> git rm -r *
<bartbes> git commit -m "Fixed all bugs"
<bartbes> git push
- TechnoCat
- Inner party member
- Posts: 1611
- Joined: Thu Jul 30, 2009 12:31 am
- Location: Denver, CO
- Contact:
Re: Main Menu
AABB can help you! http://silentmatt.com/rectangle-intersection/
- baconhawka7x
- Party member
- Posts: 491
- Joined: Mon Nov 21, 2011 7:05 am
- Location: Oregon, USA
- Contact:
Re: Main Menu
well, to draw the button you would use love.graphics.draw()
then in the function love.mousepressed() you would have to say:[/quote]
thank you soooooo much!!!!
then in the function love.mousepressed() you would have to say:
Code: Select all
if x > button.x and
x < button.x + button.img:width and
y > button.y and
y < button.y + button.img:height then
--button action
end
thank you soooooo much!!!!
- josefnpat
- Inner party member
- Posts: 955
- Joined: Wed Oct 05, 2011 1:36 am
- Location: your basement
- Contact:
Re: Main Menu
No problem, good luck on your gamebaconhawka7x wrote:well, to draw the button you would use love.graphics.draw()
then in the function love.mousepressed() you would have to say:thank you soooooo much!!!!josefnpat wrote:Code: Select all
if x > button.x and x < button.x + button.img:width and y > button.y and y < button.y + button.img:height then --button action end
Missing Sentinel Software | Twitter
FORCIBLY IGNORED.
<leafo> when in doubt delete all of your code
<bartbes> git rm -r *
<bartbes> git commit -m "Fixed all bugs"
<bartbes> git push
FORCIBLY IGNORED.
<leafo> when in doubt delete all of your code
<bartbes> git rm -r *
<bartbes> git commit -m "Fixed all bugs"
<bartbes> git push
Who is online
Users browsing this forum: Bing [Bot] and 87 guests