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 / Cockpit images only seen in window, masking question DBC ?

Author
Message
Newbie5UK
21
Years of Service
User Offline
Joined: 13th Nov 2004
Location:
Posted: 3rd Feb 2006 18:37
If I have a cockpit of a space vehicle for example, how do I limit graphics to an area of a window and how do I caculate what shgould be seen and what should not ?

Newbie, so not sure what the correct terms are.. pls advise. and post examples if possible.. thx
dab
21
Years of Service
User Offline
Joined: 22nd Sep 2004
Location: Your Temp Folder!
Posted: 4th Feb 2006 08:10
Well, you can set the screen size on the window view, and the full screen view. Though, if you want to have the size change at anytim through the game, you could get the size of the screen on the right and bottom, and just add/subtract from there. Such as :



If that's not what you meant, then to keep the image from leaving the view, just do this:



Hope any of these were what you meant.

Newbie5UK
21
Years of Service
User Offline
Joined: 13th Nov 2004
Location:
Posted: 4th Feb 2006 11:11
I guess I meant if an object was to pass in front of you, then when it is behind the frame of the window you would not see it, but then as it moves across to another window it becomes visible again.

Therefore some sort of calulation for if it is visible or not withiong the area of a display window, i.e cockpit window with object passing by infront..
Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 4th Feb 2006 12:01 Edited at: 4th Feb 2006 12:03
3D??? Lock the cockpit as a plain to the screen. Everything should go behind it if you keep its Z value lower than any other object.

If it's 2D bitmaps you can use the copy bitmap command to copy a square area from one screen to another. So you could copy a square area from screen 1 to screen 0, and that would be the window.

If it's a bitmap odd/shape window, you would need a picture of the window frame, and black 0,0,0 for the glass. You would move all of the objects that you can see through the glass, then paste the window image down later. This would work for a circle for example.

None of these examples will work with sprites however. The only thing that can hide a sprite is another sprite.

Newbie5UK
21
Years of Service
User Offline
Joined: 13th Nov 2004
Location:
Posted: 4th Feb 2006 13:14
It is 3D, how do I lock a plain to the screen ? thx
Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 4th Feb 2006 14:01 Edited at: 4th Feb 2006 14:03
Lock Object On ObjectNumber

The object should have some Z value in front of the camera. Scoring etc needs to be also locked to the screen, but with a Z value in front of this window......... like layers.

Your window should be black 0,0,0.

Set Object ObjectNumber,1,0,1 will make the black transparent.

Newbie5UK
21
Years of Service
User Offline
Joined: 13th Nov 2004
Location:
Posted: 4th Feb 2006 18:04
Great I'll try that... I have DBC btw so hopefully that with work... thx

Login to post a reply

Server time is: 2026-07-07 13:15:03
Your offset time is: 2026-07-07 13:15:03