Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
0 registered members (), 18,561 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Center of the viewport! #306176
01/20/10 10:48
01/20/10 10:48
Joined: Jan 2010
Posts: 4
F
fireapach3 Offline OP
Guest
fireapach3  Offline OP
Guest
F

Joined: Jan 2010
Posts: 4
Hey everybody! How can i do to calculate the center of the viewport independent of the resolution of the game?

PS: I've tried using screen_size, but without success... ¬¬

Code:
video_mode = 8;

int centrox = screen_size.x * 0.5;

if(centrox == 512)
{
   "do it"
}



Re: Center of the viewport! [Re: fireapach3] #306179
01/20/10 11:07
01/20/10 11:07
Joined: Nov 2007
Posts: 1,143
United Kingdom
DJBMASTER Offline
Serious User
DJBMASTER  Offline
Serious User

Joined: Nov 2007
Posts: 1,143
United Kingdom
I assume this is inside the 'main' function. You need a 'wait(1);' after 'video_mode = 8' because you need to give the directX device 1 frame to set up the vars.

Last edited by DJBMASTER; 01/20/10 11:57.
Re: Center of the viewport! [Re: DJBMASTER] #306198
01/20/10 13:06
01/20/10 13:06
Joined: Jan 2010
Posts: 4
F
fireapach3 Offline OP
Guest
fireapach3  Offline OP
Guest
F

Joined: Jan 2010
Posts: 4
Wow! Thanks! XD


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