Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by fairtrader. 12/06/23 11:29
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
7 registered members (fairtrader, Quad, miwok, Martin_HH, AndrewAMD, alibaba, dpn), 581 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 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 | 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