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 Professional Discussion / Desktop Width and Desktop Height problem

Author
Message
YavinB
16
Years of Service
User Offline
Joined: 25th Sep 2009
Location: Ontario, Canada
Posted: 19th Nov 2010 00:11
I'm trying to set the window size to the deskop width and height. But every time I do it, all the text gets cut off. Here's the code:



I attached a screen shot of it.

Thanks.
Sasuke
20
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 19th Nov 2010 00:51 Edited at: 19th Nov 2010 00:51
This could be due to your IDE display settings being set to Windowed. Changing it to Windowed Fullscreen will sort this. Depending on the IDE, you'll find it in setting and display settings or in the project manager and look for graphics mode.

A dream is a fantasy, if you achieve that fantasy it was never a dream to begin with.
YavinB
16
Years of Service
User Offline
Joined: 25th Sep 2009
Location: Ontario, Canada
Posted: 19th Nov 2010 01:05 Edited at: 19th Nov 2010 01:43
I'm using the IDE that came with Dark Game Studio and there isn't any Windowed Fullscreen there.

Any other ideas?
Sasuke
20
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 19th Nov 2010 01:56


Is this your one?

In the code view where it shows folders, right at the bottom there are a few tabs. The settings one is in one of them. I don't use the DPB stock IDE's so your going to have to explore it until you find some display settings.

A dream is a fantasy, if you achieve that fantasy it was never a dream to begin with.
DVader
22
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 19th Nov 2010 02:16
All I can see from your snippet is you haven't included sync on and sync in the main loop.



That's probably it.

http://s6.bitefight.org/c.php?uid=103081
YavinB
16
Years of Service
User Offline
Joined: 25th Sep 2009
Location: Ontario, Canada
Posted: 19th Nov 2010 03:16 Edited at: 19th Nov 2010 03:25
@Sasuke

Yep that's the IDE I have.

There are only:

fullscreen
window
desktop
fulldesktop
hidden

avaible for screen types.

@DVader

It still makes the text cut off.
DVader
22
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 19th Nov 2010 06:26 Edited at: 19th Nov 2010 06:31
This works for me, the old code did as well although in window mode as the editor is set to that.

I definitely see text on my screen and doesn't seem cut off. So if you don't there's some odd problem. For screen types in the editor use either full screen or full screen desktop. Although my editor is set to window, disabling window mode automatically puts it into full screen mode, so shouldn't really be needed, unless you don't use the set window off command.

http://s6.bitefight.org/c.php?uid=103081
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 19th Nov 2010 09:28
Try fulldesktop

TheComet

YavinB
16
Years of Service
User Offline
Joined: 25th Sep 2009
Location: Ontario, Canada
Posted: 19th Nov 2010 15:54 Edited at: 19th Nov 2010 16:12
Fulldesktop works. But I don't want my program to be fullscreened. I tried putting it into windowed mode while in the program and it still cuts the text off.
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 19th Nov 2010 17:09
If you're referring to the missing text at the bottom of the screen it looks on my laptop as if it's to allow space for the Windows taskbar - otherwise you wouldn't see the last line or two of text when you have the taskbar showing.

That's just a guess though.
YavinB
16
Years of Service
User Offline
Joined: 25th Sep 2009
Location: Ontario, Canada
Posted: 19th Nov 2010 17:31 Edited at: 19th Nov 2010 17:40
@Green Gandalf

The problem is when I set the window size using:



Any text gets cut off. I've been trying to figure out how to get rid of this problem for 1-2 months now and I can't figure it out. I attached the exact problem with it.
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 19th Nov 2010 17:45
Try it like this:


YavinB
16
Years of Service
User Offline
Joined: 25th Sep 2009
Location: Ontario, Canada
Posted: 19th Nov 2010 17:51
@baxslash

The code I posted was just an example of the problem I'm having.
I'm trying to make a painting program and the problem is any text gets cut in half or gone.
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 19th Nov 2010 18:01
Oh, I see. The problem is you are setting your window (not including the borders) to the size of the desktop.

Try this then:


YavinB
16
Years of Service
User Offline
Joined: 25th Sep 2009
Location: Ontario, Canada
Posted: 19th Nov 2010 18:09
Aha! Thanks! Just 1 little problem, when I maximize the window it still cuts some of the text off.
KISTech
18
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 19th Nov 2010 18:13
If the window borders are showing, and that's what you want, then set your display mode to Desktop Width() - (border size) and Desktop Height() - (border size)

YavinB
16
Years of Service
User Offline
Joined: 25th Sep 2009
Location: Ontario, Canada
Posted: 19th Nov 2010 18:18
@KISTech

The only problem I have now is when the window is maximized it cuts the text off. But thanks anyway.
Neco
18
Years of Service
User Offline
Joined: 13th Jul 2008
Location: Waterloo, Wisconsin USA
Posted: 19th Nov 2010 18:27
Solution.. Run full screen mode if you want it maximized

KISTech
18
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 19th Nov 2010 18:28
If you've already set the window to Desktop Width()-border, Desktop Height()-border, then it's already maximized. This isn't an ordinary Windows style window. So if you maximize it then it will "attempt" to fill in the area it's already filled, but DirectX views that as also taking up the area that you don't want filled. (ie, the borders and task bar area.

It's like telling DirectX to go fullscreen, but you're still viewing it through a window.

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 19th Nov 2010 18:33
Quote: "Any text gets cut off."


Quote: "it still cuts some of the text off."


Could you explain what you mean precisely? Just take a typical screenshot and edit it in Paint with arrows pointing at the "cutoff" point.

The last image you posted didn't tell me anything - I see 6 lines of text. The first image had many more lines and the only obvious thing was the missing lines at the bottom.

You'll obviously lose part or all of a line at the top if you keep printing but I assume that's not what you mean.

I'm glad baxslash knows what the problem is because I'm even more baffled now.
YavinB
16
Years of Service
User Offline
Joined: 25th Sep 2009
Location: Ontario, Canada
Posted: 19th Nov 2010 18:41
@Neco

I want the Window maximized. Not going into fullscreen.

@Green Gandalf

What I mean is, When I print text to the screen (or use text) the top or bottom of the text gets cut off. I dont know how to explain it any better than that.

Image attached.
Neco
18
Years of Service
User Offline
Joined: 13th Jul 2008
Location: Waterloo, Wisconsin USA
Posted: 19th Nov 2010 18:59 Edited at: 19th Nov 2010 19:00
Without knowing how you intend to show text and in what manner, if you have very tight control over what is getting printed and where, in your code, then you should try sacrificing a few viewable lines of text, by increasing the Y spacing between all lines. See if for whatever reason it stops the cutoff..

Otherwise..some kind of scaling bug?

KISTech
18
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 19th Nov 2010 19:00 Edited at: 19th Nov 2010 19:03
AHHH, I see.

That's DirectX trying to "compress" your content into a window sized different than a non-standard display mode setting.

[edit]
It's a combination of that, and the problem I mentioned above.

Try running the same program, but set the display mode to 1024, 768 and see what it does. I'm guessing the text will be bigger when you maximize the window, as it's then stretching the window to fill the area you tell it to.

YavinB
16
Years of Service
User Offline
Joined: 25th Sep 2009
Location: Ontario, Canada
Posted: 19th Nov 2010 19:13
@Neco

I'm making a painting program. When the user inputs text, the texts gets cut in half. I have no control where the user puts the text. The code I posted is an example of the problem.

@KISTech

Im confused.
KISTech
18
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 19th Nov 2010 19:32
With your application maximized, but still in a window, you're using a non-standard resolution. (not 800x600, 1024x768, etc..)

DirectX / DBPro is doing it's best to "fit" your text into that, but it will chop rows of pixels (in 2D where text lives) to make it work.

Set your display mode to a standard resolution that's smaller than your desktop (800x600 for example) and then maximize that. You'll see what I mean. It stretches the text to make it fit the area.

What you are doing by setting the display mode to close to the desktop resolution is you are losing lines in your text as it tries to compress it to make it fit in the maximized window.

Try
set display mode Desktop width()-48, Desktop height()-64, 32

and then maximize the window and see if the problem doesn't go away.

YavinB
16
Years of Service
User Offline
Joined: 25th Sep 2009
Location: Ontario, Canada
Posted: 19th Nov 2010 19:38
Yay it fixed it! Thanks!
KISTech
18
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 19th Nov 2010 19:52
No problem.

Login to post a reply

Server time is: 2026-07-21 18:58:33
Your offset time is: 2026-07-21 18:58:33