QB Layers?

If you have questions about any aspect of QBasic programming, or would like to help fellow programmers solve their problems, check out this board!

Moderators: Pete, Mods

User avatar
Mitth'raw'nuruodo
Veteran
Posts: 839
Joined: Sat Jan 22, 2005 11:04 am
Location: Eastern Coast of US
Contact:

QB Layers?

Post by Mitth'raw'nuruodo »

Does QB have something like a .Layers object, you should know what I'm taking about.
"But...It was so beutifully done"
Rattrapmax6
Veteran
Posts: 1055
Joined: Sun Jan 02, 2005 2:11 pm
Location: At my computer
Contact:

Post by Rattrapmax6 »

If you on layering like CADing, I don't think so,.. course, I might be on a diff subject.. :wink:
-Kevin (aka:Rattra)
(x.t.r.GRAPHICS)
User avatar
Mitth'raw'nuruodo
Veteran
Posts: 839
Joined: Sat Jan 22, 2005 11:04 am
Location: Eastern Coast of US
Contact:

Post by Mitth'raw'nuruodo »

hmmm...CADing....CADing....where hav I heard that before. Isn't that like some Architect Graphing software?

Ummm...I'm talking about like lets say you have a peice of graphic that you want in the forground, but all you want is to change its position and everything in the layer behind it drawn is not messed around with, like the internet uses layers, the mouse uses layers, windows uses layers.

Well, that's what I mean.
"But...It was so beutifully done"
Nodtveidt
Veteran
Posts: 826
Joined: Sun Jul 25, 2004 4:24 am
Location: Quebradillas, PR
Contact:

Post by Nodtveidt »

I thought you knew lots about QB? :? :lol:

QB doesn't natively support layers, but you can use a graphics library which does.

CAD: Computer Assisted Drafting (or Design, depending on what industry you're in).
User avatar
{Nathan}
Veteran
Posts: 1169
Joined: Thu Aug 19, 2004 6:08 pm
Location: The wetlands of central Ohio, USA
Contact:

Post by {Nathan} »

Actually, QB does support layers. In screen 7, there are different pages. Use pcopy to copy pages and look at the screen syntax on how to set the page (leave colorswitch blank)
User avatar
Mitth'raw'nuruodo
Veteran
Posts: 839
Joined: Sat Jan 22, 2005 11:04 am
Location: Eastern Coast of US
Contact:

Post by Mitth'raw'nuruodo »

Now...Now...I didn't say I knew everything Nek. :wink: . I'm probably going to get another identical comment from you with my other post on the SPACE WARP [POLL] topic. *sigh* Everyone's learns something every day and if they don't shame on them. :D

So SCREEN pages are Layers Nate, I thought they we're more like "pages" where one page shows up at a time on the SCREEN.

But if they all show up on the SCREEN in different Layers then thats a different story....I 'll have to experiment.

BTW Nate, SCREEN pages are NOT limited to SCREEN 7 that much I know, other SCREENs have them in different numbers, I believe some some SCREENs have 1, 2, 8, and some as many as you want as long as there is memory availible for them. :wink:
"But...It was so beutifully done"
Z!re
Veteran
Posts: 887
Joined: Wed Aug 04, 2004 11:15 am

Post by Z!re »

QB Help:

Code: Select all

      VGA Screen Modes:
                Rows and              Page
        Mode    Columns   Resolution  Size    Pages
        0       40x25     360x400      -      8
                40x43     320x350      -      8
                40x50     320x400      -      4
                80x25     720x400      -      8
                80x43     640x350      -      4
                80x43     720x350      -      4
                80x50     640x400      -      4
                80x50     720x400      -      4
        1       40x25     320x200      16K    1
        2       80x25     640x200      16K    1
        7       40x25     320x200      32K     (a)
        8       80x25     640x200      64K     (a)
        9       80x25     640x350     128K     (a)
                80x43     640x350     128K     (a)
        10      80x25     640x350      64K     (b)
                80x43     640x350      64K     (b)
        11      80x30     640x480      64K    1
                80x60     640x480      64K    1
        12      80x30     640x480     256K    1
                80x60     640x480     256K    1
        13      40x25     320x200     64K     1
        _____________________________________________________________________
        (a)  Pages = Screen memory divided by page size. Eight page maximum.
        (b)  Pages = Screen memory divided by 2 divided by page size. Eight
                     page maximum.
Note that screen 0 is text only.


QB has no layer support.
Screen pages are not layers.

If you use screen 13 you can easily write your own layer handling engine. Quite easy.
I have left this dump.
User avatar
Mitth'raw'nuruodo
Veteran
Posts: 839
Joined: Sat Jan 22, 2005 11:04 am
Location: Eastern Coast of US
Contact:

Post by Mitth'raw'nuruodo »

:D :D :D See...See..I was right its not limited to SCREEN 7. :D :D :D

:cry: :cry: :cry: But I'm disapointed about that they aren't layers.... :cry: :cry: :cry:

But...there is hope! Z!re why only SCREEN 13? Is there something more special about that one that I can wright a layer engine easilier?

I would like to thank you Z!re for the QB help but I'm not too lazy to go look at it in QB like others. In fact I've been there a lot (including this page). :D
"But...It was so beutifully done"
Z!re
Veteran
Posts: 887
Joined: Wed Aug 04, 2004 11:15 am

Post by Z!re »

64kb is the maximum amount of memory you can allocate in a array in QB, an array acts like a layer or buffer.

As long as the screen is 64kb or less in size, you can create layers.

The reason many go with screen 13, is that you get 256 colors.


I suggest you download SuperPut, and SetVideoSeg

And learn how to use them.
I have left this dump.
User avatar
Mitth'raw'nuruodo
Veteran
Posts: 839
Joined: Sat Jan 22, 2005 11:04 am
Location: Eastern Coast of US
Contact:

Post by Mitth'raw'nuruodo »

Well I already seen SetVideoSeg and it was way beyound me.

But I believe I could come up with a layer-based scheme function on my own. :D
"But...It was so beutifully done"
Rattrapmax6
Veteran
Posts: 1055
Joined: Sun Jan 02, 2005 2:11 pm
Location: At my computer
Contact:

Post by Rattrapmax6 »

:) Sorry, lol,. I have a AutoCAD sorta program called IntelliCAD... and layering is when you well layer your drawing to be able to brake it down in parts...

I've heard of a masking that works on backround layers tho. Like your mouse comment,. say I'm going to set a sprite on the backround, I capture that little bit of space where its going to go, then lay the sprite.

When I move the sprite, I set the mask back where it went, capture the next sprite location, then set the sprite there. If thats what you want, its right simple. :wink:
-Kevin (aka:Rattra)
(x.t.r.GRAPHICS)
User avatar
Mitth'raw'nuruodo
Veteran
Posts: 839
Joined: Sat Jan 22, 2005 11:04 am
Location: Eastern Coast of US
Contact:

Post by Mitth'raw'nuruodo »

Yes, ok, thanks for the help. I got it.

The reason I was asking because I wanted to start playing with the mouse a little. AKA make my own mouse cursor that corresponds to the mouse. Now that I think about it pretty simple, right?

Just gotta get mouse coord, get other graphic points, clear screen, draw other graphic points, draw mouse cursor at points, pause, loop

This will work because all layers is is just sorting the order of drawing the objects. The ones in the back first to the ones on top. They will just cover up one another, simple. Since the mouse is on the top layer, you just draw it last and no harm comes to your graphics, you just have to draw everything every loop. Or at least everytime your grapics change or the mouse coordinates....

I was just wondering if there was something in QB that would do that automaticaly. But I'll just have to do it manually... :D
"But...It was so beutifully done"
Nodtveidt
Veteran
Posts: 826
Joined: Sun Jul 25, 2004 4:24 am
Location: Quebradillas, PR
Contact:

Post by Nodtveidt »

Doing a manual mouse cursor is rather easy. You have to take a couple things into consideration though:

1. You'll need an array just as large as the mouse cursor to grab the pixels behind the cursor
2. Unless you're using XOR to PUT it, you'll need a mask array as well, which will also be the same size

For a normal mouse cursor, the trick is to turn the cursor off before doing any blitting. Then, once your blits are done, turn it back on.
User avatar
Mitth'raw'nuruodo
Veteran
Posts: 839
Joined: Sat Jan 22, 2005 11:04 am
Location: Eastern Coast of US
Contact:

Post by Mitth'raw'nuruodo »

Umm...Nek I think I like my way better (artifical layers). Read my post above.

But if flickering gets to be a problem then I'll have to do it the other way. :D
"But...It was so beutifully done"
Z!re
Veteran
Posts: 887
Joined: Wed Aug 04, 2004 11:15 am

Post by Z!re »

Just sort by a depth value, and draw the objects deepest into the screen first, with the mouse being the last.
I have left this dump.
User avatar
Mitth'raw'nuruodo
Veteran
Posts: 839
Joined: Sat Jan 22, 2005 11:04 am
Location: Eastern Coast of US
Contact:

Post by Mitth'raw'nuruodo »

Thank you Z!re thats what I was talking about. :D . But thanks.
"But...It was so beutifully done"
Nodtveidt
Veteran
Posts: 826
Joined: Sun Jul 25, 2004 4:24 am
Location: Quebradillas, PR
Contact:

Post by Nodtveidt »

You want an entire layer for a mouse cursor? Wow, talk about inefficient. :roll:
Z!re
Veteran
Posts: 887
Joined: Wed Aug 04, 2004 11:15 am

Post by Z!re »

He doesent mean layers, he means Z-Ordering sprites/objects
I have left this dump.
Nodtveidt
Veteran
Posts: 826
Joined: Sun Jul 25, 2004 4:24 am
Location: Quebradillas, PR
Contact:

Post by Nodtveidt »

Umm...that's common practice... :?
Z!re
Veteran
Posts: 887
Joined: Wed Aug 04, 2004 11:15 am

Post by Z!re »

Yup, thats why he wants to do it, everyone realizes it's good :P
I have left this dump.
Post Reply