Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (AndrewAMD, Akow, degenerate_762), 1,430 guests, and 9 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19055 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 | chip programmers | 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