Buttons

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
roggie12
Prole
Posts: 13
Joined: Sat May 25, 2013 6:00 pm
Location: The Matrix

Buttons

Post by roggie12 »

I have been stuck on buttons for about a week and I can't seem to understand how to make them. I know how to make menus so buttons are the only things that I need to know. I've been learning from a guy on YouTube and I do the exact same code that he does except I make the button say something different but except for that the button should still work.

Any Help is much appreciated, thanx
User avatar
Plu
Inner party member
Posts: 722
Joined: Fri Mar 15, 2013 9:36 pm

Re: Buttons

Post by Plu »

Without a specific question it's kinda hard to help you. Do you have a code sample or a specific issue you're having?

Also if you're doing buttons, consider using an existing library like http://love2d.org/wiki/Quickie or https://love2d.org/wiki/L%C3%B6ve_Frames
jjmafiae
Party member
Posts: 1331
Joined: Tue Jul 24, 2012 8:22 am

Re: Buttons

Post by jjmafiae »

roggie12 wrote:I have been stuck on buttons for about a week and I can't seem to understand how to make them. I know how to make menus so buttons are the only things that I need to know. I've been learning from a guy on YouTube and I do the exact same code that he does except I make the button say something different but except for that the button should still work.

Any Help is much appreciated, thanx
without a love file or your code we cant help you :3
User avatar
T-Bone
Inner party member
Posts: 1492
Joined: Thu Jun 09, 2011 9:03 am

Re: Buttons

Post by T-Bone »

You need to be more specific. Exactly what is the issue? Do you have issues detecting if the user clicks inside or outside the button? Do you have issues making it visible? Or do you have issues making the button actually do something? Or something else?
User avatar
Eamonn
Party member
Posts: 550
Joined: Sat May 04, 2013 1:29 pm
Location: Ireland

Re: Buttons

Post by Eamonn »

Ok, I was talking to Roggie and he said that the reason he can't upload a .love is because he can't copy the code from the sockmunkee dev tutorial. He said anytime he does it the code doesn't work. Also, he didn't know all of you replied because he thought it would be about 5 days before anyone answered. So hopefully this catches his attention and starts to reply. Just thought this would help :D

I'm just saying what he has said about his question, I'm not saying it's right/wrong, but it's what he said and I don't think he'll see this thread...
"In those quiet moments, you come into my mind" - Liam Reilly
User avatar
raidho36
Party member
Posts: 2063
Joined: Mon Jun 17, 2013 12:00 pm

Re: Buttons

Post by raidho36 »

Copypasting, this what newbs do when they see the code.

I once told that one dude who was writing a book on certain library API, because he gave numerous multipage listings in it with minimum background explanation going on, and yet it was targeted at noobs who can't even code in C steadily. But the dude was so arrogant he didn't even had a clue that noobs could possibly act like this and that they won't learn much from that kind of book, and then he argued that he actually targets advanced programmers, and then his book was absolutely different from all the other programming books, and he was so much right in any given topic just by default, just because he's writing a book, that it ended up him put me to ignore list despite my reasonable critiques and adequately argumented statements with references to other book writers and their books. What a selfish jerk.

Moral: when you make a tutorial targeted to n00bz, make sure you post maximum text and minimum copypastable code. This forces students to actually study the thing.
User avatar
Plu
Inner party member
Posts: 722
Joined: Fri Mar 15, 2013 9:36 pm

Re: Buttons

Post by Plu »

Copypasting is actually a good way of learning by mucking around, which is the preferred method of learning for a large number of students. It's just one of the types of learning, just like learning by reading theory is. Not everyone enjoys learning in the same way. I used a lot of copy-pasta to learn coding when I was younger, because it allowed me to take something working and see what happens when you changed parts of it.
User avatar
raidho36
Party member
Posts: 2063
Joined: Mon Jun 17, 2013 12:00 pm

Re: Buttons

Post by raidho36 »

It's very arguable that studying programming should start with messing with the code. It does lets you to actually dig in, but it hardly teach you anything at all. You can see result of this approach everywhere, e.g. people who would program for long time already yet can't use arrays or fail to understand use of pointers.
User avatar
Plu
Inner party member
Posts: 722
Joined: Fri Mar 15, 2013 9:36 pm

Re: Buttons

Post by Plu »

It can teach you a lot. Just not everything. At some point you should probably move on to studying design patterns and a bit of theory.

Of course, at that point, you no longer need a book aimed at "noobz" anymore.

(Also teaching new programmers about pointers is probably one of the fastest ways to remove any desire to become a programmers. You should probably start with something more approachable first.)

(Also also, I still barely get pointers, and I get paid to program stuff. There's loads of software development going on that has long since abstracted away pointers.)
User avatar
raidho36
Party member
Posts: 2063
Joined: Mon Jun 17, 2013 12:00 pm

Re: Buttons

Post by raidho36 »

This is why you should've started with learning principles to programming rather than THE programming, and any other man should. You don't start driving a car with mashing pedals and gearbox and spinning the steering wheel around.
Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 4 guests