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.

Author
Message
Benjames8
16
Years of Service
User Offline
Joined: 6th Jan 2010
Location: Your Nightmares
Posted: 21st Aug 2010 00:09
I want to set my display to 1000 by 750 and set the window position to the middle of the screen like:
"(desktop width()/2)-500"
then have the remaining bordering pixels be black, that way if the mouse is clicked outside of the screen it won't try to bring other windows to the front, as if the window were maximized
swissolo
16
Years of Service
User Offline
Joined: 9th Jan 2010
Location:
Posted: 21st Aug 2010 01:28

Just make sure it's fullscreen.

swis
Benjames8
16
Years of Service
User Offline
Joined: 6th Jan 2010
Location: Your Nightmares
Posted: 21st Aug 2010 02:49 Edited at: 21st Aug 2010 02:59
lol :SET CAMERA VIEW Camera Number, desktop width()/2-500, desktop height()/2-375, desktop width()/2+500, desktop height()/2+375

that would work if the diplay mode was set to the desktop's width and hieght. This is not what im looking for, unless it has the same effect on performance as setting the display mode to 1000,750. I did a little frame rate test but Im still not sure. It will work for now thanksolo

[edit] o ya the 2d view is effected by this, i need like the whole window centered and bordered i guess. all of my menu code is based off this uhg.
DVader
22
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 21st Aug 2010 17:13
You could change desktop width to screen width etc, for making a window within your main screen.

http://s6.bitefight.org/c.php?uid=103081
swissolo
16
Years of Service
User Offline
Joined: 9th Jan 2010
Location:
Posted: 21st Aug 2010 19:42
Isn't the whole point having the display mode set to the desktop's width and height?

swis
DVader
22
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 22nd Aug 2010 22:29
Sounds like he wants the window centered in the desktop to me. Then somehow making impossible to click anywhere off the window. I would have thought full screen exclusive would sort that out. Just make a border in your program if you want one.

http://s6.bitefight.org/c.php?uid=103081
Benjames8
16
Years of Service
User Offline
Joined: 6th Jan 2010
Location: Your Nightmares
Posted: 22nd Aug 2010 22:42 Edited at: 22nd Aug 2010 22:45
Yes DarthVader that is correct. Can using draw to camera; in some way allow me to use the code for drawing 2d i already have. Instead of changing all of it to work around the camera's position on the screen?

Pretty much i want the users diplay to stay the same but limit the size of the "window/screen/drawing area"
DVader
22
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 22nd Aug 2010 23:28
Have you an example of what you are trying to do? Are you trying for a bigger screen than the window? Is it a drawing package or object placement? Any screenies? Might give more idea of exactly what you want. I get the basic thread but unsure why you need to do this. What are you making?

http://s6.bitefight.org/c.php?uid=103081
Benjames8
16
Years of Service
User Offline
Joined: 6th Jan 2010
Location: Your Nightmares
Posted: 22nd Aug 2010 23:39
Here is the inventory stuff ive been working on, I need this to be centered with a border with the same non-click effect as maximize window. If i can't figure it out I have to change pretty much all of the code before moving it to my game.
Benjames8
16
Years of Service
User Offline
Joined: 6th Jan 2010
Location: Your Nightmares
Posted: 22nd Aug 2010 23:46
Also here is a picture 1360x768 ; this could be like what the user has its display set to. The blue portion with the smiling face is the "window/screen/drawing area"
swissolo
16
Years of Service
User Offline
Joined: 9th Jan 2010
Location:
Posted: 23rd Aug 2010 01:40 Edited at: 23rd Aug 2010 01:43
So if you want that area to be visible (see the desktop) just position the window in the middle of the screen and move it to the front ever second or something, alternitavly you could use my method and show a screenshot of the desktop.
Edit: Ohh, 2D. Hmmm... just have a black border or what I said above I guess.

swis
DVader
22
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 24th Aug 2010 18:20 Edited at: 24th Aug 2010 18:33
So the problem you have is you are using co-ordinates based around 0,0 onwards and you want a border around instead?
Here is a little routine I have knocked together. That sort of does what you are saying I think lol. If you have some sort of grid management on the exe you posted I would think it fairly easy to alter the co-ordinates.

That can be used to limit where you click. I have made it so it knows if you are clicking the window or border here though. Obviously you can change x,y,x1 etc to values you want. It will work automatically with any window size you choose. The screen flashing is because I was lazy refreshing the text. Obviously you would have your own drawing routine for things so not bothered using a image to blank the text instead of cls.

Couple of amendments in this one so it draws instead of just checks position and doesn't flash lol.

http://s6.bitefight.org/c.php?uid=103081
Sixty Squares
20
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 24th Aug 2010 21:54
IanM's Matrix1 plugin lets you choose where your game's graphics are drawn to. In this example the program draws everything to an image. Then it resizes the image and draws it in the middle of the screen for you on the normal camera.



Images will look stretched unless you change the height of the image when it is put on the camera though. But the mouse coordinates will read incorrectly unless they are offsetted like so:

mx=mousex()-BorderWidth

Anyway, you might end up having to offset all of your sprites by the width of the border instead of using this idea. But this idea could work if you use the right proportions for the resolution and everything. The "new" resolution (the size of the box in the middle) would have to be in proportion with the normal resolution. so things wouldn't look stretched.


Guns, cinematics, stealth, items and more!
Benjames8
16
Years of Service
User Offline
Joined: 6th Jan 2010
Location: Your Nightmares
Posted: 25th Aug 2010 21:44
Thanks for the advice guys but I ended up doing the work of adding desktop width()/2-500 to my x and desktop height()/2-375 to my y for all of my 2d cammands, it acually ended up only being like 9 lines of code 1;
DVader
22
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 25th Aug 2010 23:01
Lol, like I said wouldn't be hard

http://s6.bitefight.org/c.php?uid=103081

Login to post a reply

Server time is: 2026-07-23 12:10:39
Your offset time is: 2026-07-23 12:10:39