Hello, its me again!
Sorry for the big amount of questions but i am enjoying those answers in here
sSo next step:
How to realize Buttons?
I mean those clicky Buttons like in Java, how to do it in love or how to do it in 2d ways?
Thank you!
How to add "Buttons"?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
How to add "Buttons"?
Intrested in making music? Theres a Virtual Drum - Software for LÖVE
http://love2d.org/forum/viewtopic.php?f ... bumm#p4193
http://love2d.org/forum/viewtopic.php?f ... bumm#p4193
Re: How to add "Buttons"?
Buttons? What? Maybe you're looking for one of the GUI libraries that you can use to make buttons: bottom-right area of main wiki page
Now posting IN STEREO (where available)
new stuff
So Mates,
holidays...sun is shining and i am sitting in front of my PC and try to add buttons bymyself,
i am not the best programmer but ill try it to figure it out so.
I've got a way to display "buttons" but: (Jeah the big BUT..)
I dont know how the hell i can identify my buttons with names..ill post my way to do it.
So thats my way! A function with alot of parameters.
It creates a rectangle with a text in it, if it created once, i couldnt "talk to it"
thats all thank you
holidays...sun is shining and i am sitting in front of my PC and try to add buttons bymyself,
i am not the best programmer but ill try it to figure it out so.
I've got a way to display "buttons" but: (Jeah the big BUT..)
I dont know how the hell i can identify my buttons with names..ill post my way to do it.
Code: Select all
--[[Functions]]--
--[[ A function to create a Button with a couple of Attributes
Attributes:
name = name of the button *test*
type = is it filled?
x_start = start-position X-Axis
y_start = start-position Y-Axis
witdh = witdh off the button
height = height off the button
caption = text in the middle of the button
text_color = color of the text
color = color of the button
]]--
function create_button(type,x_start,y_start,witdh,height,caption,text_color,color,nr)
love.graphics.setColor( color )
love.graphics.rectangle( type, x_start, y_start, witdh, height)
love.graphics.setColor( text_color )
love.graphics.draw(caption,x_start+witdh/2-font_size/2,y_start+height/2)
end
It creates a rectangle with a text in it, if it created once, i couldnt "talk to it"
thats all thank you
Intrested in making music? Theres a Virtual Drum - Software for LÖVE
http://love2d.org/forum/viewtopic.php?f ... bumm#p4193
http://love2d.org/forum/viewtopic.php?f ... bumm#p4193
- qubodup
- Inner party member
- Posts: 775
- Joined: Sat Jun 21, 2008 9:21 pm
- Location: Berlin, Germany
- Contact:
Re: How to add "Buttons"?
Tables
Please let us know whether you're ok with reading this documentation (and whether you understood how to use them if you did) or if you need more guidance.
Please let us know whether you're ok with reading this documentation (and whether you understood how to use them if you did) or if you need more guidance.
lg.newImage("cat.png") -- made possible by lg = love.graphics
-- Don't force fullscreen (it frustrates those who want to try your game real quick) -- Develop for 1280x720 (so people can make HD videos)
-- Don't force fullscreen (it frustrates those who want to try your game real quick) -- Develop for 1280x720 (so people can make HD videos)
Re: How to add "Buttons"?
Hey.
After reading the table stuff take a look at my sample. Arrays/Tables are necessary for mostly everything you'll ever do (in programming) so get used to them The supplied demo is really basic but it's mostly what you tried to do. Except the color Stuff, who needs colors anyway Anyways, I hope this will help you a bit. Try to modify the script a little. Maybe make a button & function to make new buttons on the fly. Should be a no-brainer.
After reading the table stuff take a look at my sample. Arrays/Tables are necessary for mostly everything you'll ever do (in programming) so get used to them The supplied demo is really basic but it's mostly what you tried to do. Except the color Stuff, who needs colors anyway Anyways, I hope this will help you a bit. Try to modify the script a little. Maybe make a button & function to make new buttons on the fly. Should be a no-brainer.
- Attachments
-
- loveButtons.love
- Simple demo for clickable buttons in Löve without frameworks
- (1.79 KiB) Downloaded 395 times
Re: How to add "Buttons"?
Thank you for the help!
@Gerrit
Thank you for this example, ill work it through the day, thanks!
...(insane help! Thank you!)
It helps me a lot, thank you for it!@qubodup
Please let us know whether you're ok with reading this documentation (and whether you understood how to use them if you did) or if you need more guidance.
@Gerrit
Thank you for this example, ill work it through the day, thanks!
...(insane help! Thank you!)
Intrested in making music? Theres a Virtual Drum - Software for LÖVE
http://love2d.org/forum/viewtopic.php?f ... bumm#p4193
http://love2d.org/forum/viewtopic.php?f ... bumm#p4193
Who is online
Users browsing this forum: Ahrefs [Bot] and 10 guests