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 / Help with mouse commands

Author
Message
Zombie 20
18
Years of Service
User Offline
Joined: 26th Nov 2006
Location: Etters, PA
Posted: 20th Sep 2007 19:13
I'm still fairly new to anything with db since I don't get a lot of chances to code which sucks since I always have a great time when I do it. Anyways, I've gotten myself stuck and I was wondering if anyone could help me out here..I have two circles drawn and what I am trying to achieve is to click within the boundaries it will take you to another message but I don't have it set up right I know I don't. I've tried a few methods so what I have shown is not everything I've attempted..can you guys point out what I'm doing wrong? Any help is apprecaited a lot and you guys rock.



Thanks a bunch..

Zombie

Zombie 20
18
Years of Service
User Offline
Joined: 26th Nov 2006
Location: Etters, PA
Posted: 20th Sep 2007 19:35
never mind, found TDK's tut on buttons, don't bring the flamethrows okay guys...I'll be fine now sorry for wasting space.

jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 20th Sep 2007 20:04
- That's funny - You almost had it Get it working? (Cicles are harder than squares btw)

Zombie 20
18
Years of Service
User Offline
Joined: 26th Nov 2006
Location: Etters, PA
Posted: 20th Sep 2007 20:23
yea i'm going with squares now..I'm doing good on it now, hurrah for zombie! Thanks for coming in though.

Zombie 20
18
Years of Service
User Offline
Joined: 26th Nov 2006
Location: Etters, PA
Posted: 20th Sep 2007 21:23
Okay run into another problem and rather than create a new thread I thought I'd use the one that I had already made earlier although this has nothing to do with mouse commands so I do apologize if you've been mislead.

What I am not attempting to do is transfer my little box made in paint over to my bitmap already on screen, the trouble is that when the image is pasted from get image\paste image or copy bitmap it still shows up as cutting into my first bitmap and not on top of it, I was wondering whats going on with that, i've run through the commands list a couple of times and would really apprecaite any help that anybody could give me, thanks for reading and here is the code.



Zombie

Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 20th Sep 2007 22:13
Hi Zombie,

So is it that you want the whole screen replaced by the second bitmap?

This first example is a "cut" like I think you described. The black square is from bitmap 1 copied to bitmap 0:



If you want all of bitmap 0 replaced with bitmap 1, you have to make sure both bitmaps are the same size, and copy the entire contents of bitmap 1 to bitmap 0.



What's your goal? Are you trying to replace part of the screen, or the whole screen? If it's just part of the screen, you may be better off loading and pasting images instead of bitmaps.

Load Image "image name.bmp",1
paste image 1,100,100

Enjoy your day.
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 21st Sep 2007 00:10 Edited at: 21st Sep 2007 00:16
I just worked this out and then read you had solved the problem lol
Well I'll post anyway.

Here's an alternative way of checking for mouse collision using only one if statement on a single line:

Just thought you might find it interesting

In programming, nothing exists
Zombie 20
18
Years of Service
User Offline
Joined: 26th Nov 2006
Location: Etters, PA
Posted: 21st Sep 2007 11:38
Hi latch and obese, haven't gotten to post a problem that latch has come into for a long time haha. What I was trying to do was paste a part of bitmap B to bitmap A. I appreciate both of you taking the time to write out the code, as always I've been helped and I couldn't be more grateful to both of you. If there's anything you guys need let the undead dude know .

Have a good one guys and thanks again!

Zombie

Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 21st Sep 2007 18:35
I'm not totally sure what you mean buuut...
try loading both bitmaps as off-screen

then you copy between them and it will actually change their properties not just the screen. You might want to make a 3rd bitmap to store the copies in, that way you can retain the original 2 bitmaps without messing them up.

In programming, nothing exists
Zombie 20
18
Years of Service
User Offline
Joined: 26th Nov 2006
Location: Etters, PA
Posted: 22nd Sep 2007 02:06 Edited at: 22nd Sep 2007 02:12
Obese- Forgot to tell you that the mouse collision code you wrote is rather interesting, and so short..its amazing at how little you had to code .

Latch, thanks a bunch to you as well. I just pasted my images on..I can be such a lunkhead sometimes since now it seems all too obvious what I should have done, thanks a lot to the both of you..back to coding here I go! To show you just real quick here's the code.



thanks guys!

Login to post a reply

Server time is: 2025-06-02 06:02:49
Your offset time is: 2025-06-02 06:02:49