Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / Button Issues

Author
Message
Zombie 20
18
Years of Service
User Offline
Joined: 26th Nov 2006
Location: Etters, PA
Posted: 22nd Sep 2007 03:45 Edited at: 22nd Sep 2007 05:42
You know what brothers and sisters, don't even worry about it, I'm going to do this on my own I cannot and will not simply run to the fourms every damn time I run into a problem, I'm gonna fix this myself..after all I'm a little embarrassed that I haven't thought of what the issue is.

Zom

TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 22nd Sep 2007 15:40 Edited at: 22nd Sep 2007 15:46
A somewhat pointless post...

But, if you get stuck, have a read of this:

Help With Buttons

[Edit] Doh! Just read the other thread where you say you know about the thread I posted above. Read it too late though!...

Also missed that the OP had been edited and now agree with db so ignore the 'pointless thread' comment.

TDK_Man

demons breath
21
Years of Service
User Offline
Joined: 4th Oct 2003
Location: Surrey, UK
Posted: 22nd Sep 2007 15:42
I assume it wasn't originally like this, but he overwrote it because he decided to figure out the problem himself, not just because he felt like filling the forum with random junk...

http://jamesmason01.googlepages.com/index.htm
Zombie 20
18
Years of Service
User Offline
Joined: 26th Nov 2006
Location: Etters, PA
Posted: 23rd Sep 2007 02:59
thats correct guys, I'm going to figure it out myself..its not even the button thats the issue haha.. I get to code tonight so i'll be on it, oh and tdk, your tuts are very well done, I love them.

Zombie 20
18
Years of Service
User Offline
Joined: 26th Nov 2006
Location: Etters, PA
Posted: 23rd Sep 2007 13:38
Update: I figured it out you guys and you know what that is a really nice feeling. Thank you all those who did look at my thread.

Clackersmith
21
Years of Service
User Offline
Joined: 4th Sep 2003
Location:
Posted: 23rd Sep 2007 14:44
Quote: "Thank you all those who did look at my thread."


Well I would have to admit it was tough going there for a bit...real touch and go stuff, but you know what Zombie? We pulled through, and the most important thing is that we all did it together. Some might say that it's moments like these that change people’s lives, you know? Bring people closer together. I for one fell we have a special bond now, others properly don’t understand what we have been through together you know? And they properly never will, but I honestly believe that this experience has made me a better person and from the bottom of my heart (*wipes away tear) I thank you...

Hehe...Couldn’t resist

That we simply are has allowed this reality we call real from the power of intangibility to pull out of inertness action, chaos and hold it into its form we call matter.
Zombie 20
18
Years of Service
User Offline
Joined: 26th Nov 2006
Location: Etters, PA
Posted: 23rd Sep 2007 15:11 Edited at: 23rd Sep 2007 15:44
I know..I felt like such an ass after reading my post again, I didn't mean any to say anyone was ignorant or arrogant but your post did make me laugh.

Besides, I'm always there for you if you ever need me, never fear for when trouble arises this shambling, rotting body will slowly come to your aid. Thanks for the comedy mate.


Okay but this time I actually do have an issue and I'm not entirely sure why the heck its not working..when I go to click on my second button it just takes me to where clicking button one would go, can anyone help me out on that one? I do need some help as I just don't see the error I've made here.



Any help on this would be greatly appreciated..as of now I'm going to sit in a tree, laters all!

Zombie

demons breath
21
Years of Service
User Offline
Joined: 4th Oct 2003
Location: Surrey, UK
Posted: 23rd Sep 2007 15:53 Edited at: 23rd Sep 2007 15:56
@clackersmith: haha ***** hilarious (sorry just remembered the whole no swearing lark).

@zombie: umm... the only thing I can think of is to check your co-ordinates...

sounds like an interesting programme though... Mock Map? Cookie? Promotion?

http://jamesmason01.googlepages.com/index.htm
Clackersmith
21
Years of Service
User Offline
Joined: 4th Sep 2003
Location:
Posted: 23rd Sep 2007 16:00 Edited at: 23rd Sep 2007 17:48
image_two: causes "screen one.bmp" to be loaded and displayed where image_one: causes "screen two.bmp" to be loaded and displayed. Are you sure this is the correct order?

EDIT - Yeah sorry I just assumed that button one went to menu01 and button two went to menu02, my mistake.

If this isn’t the problem then if you could upload you two menu images, I'll be able to double check you're co-ordinates and make sure its all working.

That we simply are has allowed this reality we call real from the power of intangibility to pull out of inertness action, chaos and hold it into its form we call matter.
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 23rd Sep 2007 16:31
Also there aren't any backslashes in your file paths.
You're not RETURNing from the check region gosub.
get rid of the wait 10000! that's the most boring thing ever

A much better way to do this program would be:


In programming, nothing exists
Zombie 20
18
Years of Service
User Offline
Joined: 26th Nov 2006
Location: Etters, PA
Posted: 23rd Sep 2007 16:33 Edited at: 23rd Sep 2007 16:39
No prob clackersmith, let me get up my title screen for ya, its made in ms paint so I hope thats okay.

tried your code obese and it didn't work, brought up the images and when I clicked my buttons they wouldn't work.

Attachments

Login to view attachments
Clackersmith
21
Years of Service
User Offline
Joined: 4th Sep 2003
Location:
Posted: 23rd Sep 2007 16:38
@OBese87 - The backslashes disappear sometimes when code is posted on these forums.

That we simply are has allowed this reality we call real from the power of intangibility to pull out of inertness action, chaos and hold it into its form we call matter.
Zombie 20
18
Years of Service
User Offline
Joined: 26th Nov 2006
Location: Etters, PA
Posted: 23rd Sep 2007 16:41 Edited at: 23rd Sep 2007 16:58
Clackersmith- oh those two images you referred to aren't in the button code, what I'm talking about is with the image attached, I wrote down my coords and put them in and its just when I click on the second button it should clear the screen and say 'you did it' but instead it acts as if I hit the first button saying new game and goes through all of those subroutines.

haha *sigh* I wonder when mr. zombie will be able to even code something like making a menu without any help.

Clackersmith
21
Years of Service
User Offline
Joined: 4th Sep 2003
Location:
Posted: 23rd Sep 2007 17:12 Edited at: 23rd Sep 2007 17:51
Here you go Zombie, I changed around your co-ordinates so the buttons will work properly now.

As OBese87 said
Quote: ""You're not RETURNing from the check region gosub.""
which was causing a lot of your dramas. I was 95% sure this was the problem before but didn’t want to say anything until I could test it myself seeing as I never (and I mean never ever) have used goto/gosubs I'm purely a function kinda guy.

Definitely have a good look at OBese87s code to find out ways of improving yours. "Wait" commands are really a big no no along with loading media in the main loop when there is the opportunity to load everything beforehand.

In future I would suggest just printing out your MouseX() and MouseY() returns to the screen in order to quickly reference "button boundaries" for hard coding them in later.

You will need to redo your file locations for you load bitmap commands due to the forum screwing up all the backslashes.

I hope your project goes well and if you need anymore help just ask.



That we simply are has allowed this reality we call real from the power of intangibility to pull out of inertness action, chaos and hold it into its form we call matter.
Zombie 20
18
Years of Service
User Offline
Joined: 26th Nov 2006
Location: Etters, PA
Posted: 23rd Sep 2007 17:54 Edited at: 23rd Sep 2007 17:56
Thank you very much, I ran your alterations and the second button told me my one file doesn't exist though I know it does so I'm all good with that, but then the first button wouldn't activate so I'm going to have a look at that ,as well as obese's code, he and latch usually come to my rescue when I'm in need of aid.

I'm also going to take your advice and have the coords printed out to the screen, will save a lot of aggravation, once I get this button system working I'll be set as most of the game requires a lot of buttons to be pressed for movement.

Oh and thank you very much both of you for your kind words and advice.

Zombinos

TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 23rd Sep 2007 18:04 Edited at: 23rd Sep 2007 18:07
The backslashes appear in path names due to a forum bug. But, it only happens when you edit your own post.

However, it's bad practice to have paths like this anyway and should really be avoided.

What happens if you give me a copy of your program? Those files may be in a folder that doesn't exist on my machine...

Instead, you should copy the media files into the same folder as the project's DBA file and don't use a path at all. Then, all you need is:

load bitmap "concept2.bmp",0

As you are not actually modifying the images you load, I'm not sure why you are using Load Bitmap instead of Load Image...

Quote: "I'm also going to take your advice and have the coords printed out to the screen, will save a lot of aggravation, once I get this button system working I'll be set as most of the game requires a lot of buttons to be pressed for movement."


As descried in the buttons tutorial you said you'd read, this is a bad method to use when you have lots of buttons. Why didn't you use the sprite method as advised? It's so much quicker and easier...

TDK_Man

Zombie 20
18
Years of Service
User Offline
Joined: 26th Nov 2006
Location: Etters, PA
Posted: 23rd Sep 2007 18:17
Well I'll be honest with you TDK, I read the first part of it and saw how wonderful that was and so I figured, 'hell I'll learn this and I'll go make my buttons' which was a little ignorant of me and I apologize, I have your tutorial in my favorites so I will read up on the sprite one you mentioned. By the by, thank you very much for writing all of those tutorials, I have learned quite a lot from reading them and yes TDK, I do read them , I crave knowledge.

As far as the media paths go, don't know how don't know why but I somehow find a way to mix up my media putting them into folders and thus lose them and get rather annoyed when I cannot locate them, I have a suspscion that I'm an idiot sometimes.

demons breath
21
Years of Service
User Offline
Joined: 4th Oct 2003
Location: Surrey, UK
Posted: 23rd Sep 2007 18:37
don't move the media, just make a copy of it in your new folder. That means you'll still have the original media in the right place, but an extra copy which you can use for your code. Shouldn't cause a problem unless your machine is really strapped for space...

http://jamesmason01.googlepages.com/index.htm
Zombie 20
18
Years of Service
User Offline
Joined: 26th Nov 2006
Location: Etters, PA
Posted: 23rd Sep 2007 18:44
Well I'll read that tutorial a bit later, right now its getting to be around lunch time and that means snack time for zombie, then a little game time..and then later tonight when I steal the comp back I will begin applying the tutorial knowledge to my buttons and menus.

Login to post a reply

Server time is: 2025-06-02 06:22:58
Your offset time is: 2025-06-02 06:22:58