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.

Newcomers DBPro Corner / Clearing text off a selected area & text all at once.

Author
Message
boymonkey 130
18
Years of Service
User Offline
Joined: 16th Oct 2005
Location:
Posted: 11th Oct 2006 18:27
First off, I want a certain area of the screen to be cleared of text, but I don't know how I would do this. (except one way by duplicating text and a bunch of variables, but I'd rather not do that.) Are there any commands like cls, except they only clear selected areas of the screen?

Also, is there any way to get all the text to be displayed all at once, rather then as it's being typed? A hold command, somewhere, maybe?

I'm working on a falling sand game, and for starters I'm getting the menus all in working order, but I've run into this hitch. :\
Bob_42
18
Years of Service
User Offline
Joined: 15th Sep 2006
Location: Guernsey
Posted: 11th Oct 2006 18:51
well this is almost certainly not the best way, but if your background is just plain black, you can draw a black box over the text you want to remove (or if you have an image, paste a certain part of the image)

and the second question, if you put 'sync on' at the start, this will stop the program from automatically updating, and when you want the update to happen, put 'sync' in, that will update the screen

boymonkey 130
18
Years of Service
User Offline
Joined: 16th Oct 2005
Location:
Posted: 11th Oct 2006 22:49
spiffy. Thanks.
I had thought about that, but I still had more menus to add, and I wanted to see if anyone else had a solution.

And I thought I had sync on all ready, but of well. :3 Thanks.
D Ogre
20
Years of Service
User Offline
Joined: 19th Nov 2003
Location:
Posted: 11th Oct 2006 22:53
Yeah, you can do what Bob_42 had said. More specifically, you could grab and image
of the portion of the screen used for the text before any text is placed there first.
Then just re-paste the image back when you want to clear the text. You will need to
know the size and position of the area that needs to be 'back buffered' of course.

I'll try and write a function to help you out...post it later.
boymonkey 130
18
Years of Service
User Offline
Joined: 16th Oct 2005
Location:
Posted: 11th Oct 2006 23:14
Thanks again. I'm having a problem, and it's no doubt a really easy one, but my mind refuses to catch it. It's writing two totally different sets of text at the same time. I click setup, and it's displaying the setup AND File menus.

here's the snippet...

I keep looking over it, and I can't catch where I'm relating the two numbers....
Bob_42
18
Years of Service
User Offline
Joined: 15th Sep 2006
Location: Guernsey
Posted: 11th Oct 2006 23:27 Edited at: 11th Oct 2006 23:28
simple, you have missied out the brackets at the end of the second mousex on both lines, try this:



Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 12th Oct 2006 17:42
@boymonkey
You can also do page flipping. Drawing your screen on a bitmap that can't be seen then copying that to the main bitmap.

You perform all of your drawing operations including boxes, text, whatever on the unviewable screen, even clearing text... then when the screen is complete, you copy it to bitmap 0 (the viewable screen).

You can have multiple unviewable bitmaps... you could effectively swap something that you want as a stable image, and draw over it in bitmap 0 without affecting the original...

Enjoy your day.
D Ogre
20
Years of Service
User Offline
Joined: 19th Nov 2003
Location:
Posted: 13th Oct 2006 00:07
@Latch

Your absolutely right. Back buffering bitmaps would be a much simpler method of
updating, copying, and erasing the display. What was I thinking (or not thinking)?

@boymonkey 130

I recommend Latch's idea for your situation. It simply uncomplicates matters.
boymonkey 130
18
Years of Service
User Offline
Joined: 16th Oct 2005
Location:
Posted: 13th Oct 2006 03:51
thanks. ^_^ I'll try it out when I have time. (Schools squeezing me lately. D: )

Login to post a reply

Server time is: 2024-09-25 09:36:37
Your offset time is: 2024-09-25 09:36:37