Gamestudio Links
Zorro Links
Newest Posts
Camera always moves upwards?
by clonman. 11/13/25 14:04
brokerCommand PLOT_HLINE parameters
by M_D. 11/13/25 10:42
ZorroGPT
by TipmyPip. 11/10/25 11:04
Training with the R bridge does not work
by frutza. 11/05/25 00:46
Zorro 2.70
by opm. 10/24/25 03:44
Alpaca Plugin v1.4.0
by TipmyPip. 10/20/25 18:04
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
2 registered members (AndrewAMD, TipmyPip), 32,306 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sheliepaley, Blueguy, blobplayintennis, someone2, NotEBspark
19177 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
center screen #308625
02/04/10 02:12
02/04/10 02:12
Joined: Mar 2008
Posts: 45
N
nigel Offline OP
Newbie
nigel  Offline OP
Newbie
N

Joined: Mar 2008
Posts: 45
i have a widescreen monitor for my computer that is a different ratio than the 1280 x 1024 i'm using in the game. so when i try to have something in the center of the screen in my code it ends up closer to the bottom on my actual monitor. is there a way i can center the image on my screen regardless of my monitor size?

Re: center screen [Re: nigel] #308626
02/04/10 02:34
02/04/10 02:34
Joined: May 2009
Posts: 1,816
at my pc (duh)
darkinferno Offline
Serious User
darkinferno  Offline
Serious User

Joined: May 2009
Posts: 1,816
at my pc (duh)
Brifle_chrshr_pan.pos_x = (screen_size.x-bmap_width(Brifle_chrshr))/2;
Brifle_chrshr_pan.pos_y = (screen_size.y-bmap_height(Brifle_chrshr))/2;

straight from my game, didnt edit it, dont have time atm, Brifle_chrshr_pan is the panel definiton, Brifle_chrshr is the bmap point, the top one centers it horizontally, the lower one centers it vertically

Re: center screen [Re: darkinferno] #308797
02/05/10 04:20
02/05/10 04:20
Joined: Mar 2008
Posts: 45
N
nigel Offline OP
Newbie
nigel  Offline OP
Newbie
N

Joined: Mar 2008
Posts: 45
that wasn't exactly what I was asking but I figured it out anyway. thanks though, I'll probably end up using that piece of code in my game anyway.

Re: center screen [Re: nigel] #308952
02/06/10 00:24
02/06/10 00:24
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Quote:
that wasn't exactly what I was asking


Why?


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: center screen [Re: Superku] #312258
02/23/10 21:58
02/23/10 21:58
Joined: Jul 2004
Posts: 1,710
MMike Offline
Serious User
MMike  Offline
Serious User

Joined: Jul 2004
Posts: 1,710
i use:
screen-size.x/2 - pan.size_x/4


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1