window size

Get help using Construct 2

Post » Thu Feb 07, 2013 2:32 pm

hi everyone ^^ today i don't know if this is a bug or it just a mistake of what i did but see what i'm talking about in this capx :

https://dl.dropbox.com/u/90034817/scirra/bug1/manu.capx

first of all this is a small example of what i want to fix , when you try it just click P and it will open a manu like ( pause ) in the games but the weird thing is this manu comes in really weird places and the event i did it is : windowhight/2 for y , window width/2 for x . and i don't know where is the problem also i have tried all the full screen options and none of them give a good result by the way the result i want to be created on the middle while the browser if expanded or minimized see these picture of what i have seen :




B
45
S
15
G
6
Posts: 795
Reputation: 11,935

Post » Fri Feb 08, 2013 8:22 am

*bump*
B
45
S
15
G
6
Posts: 795
Reputation: 11,935

Post » Fri Feb 08, 2013 6:26 pm

Use the Viewport top/bottom/left/right values instead. WindowWidth/WindowHeight don't work well with scaling.


x = (ViewportRight("layer") - ViewportLeft("layer")) / 2
y = (ViewportBottom("layer") - ViewportTop("layer")) / 2
B
54
S
28
G
18
Posts: 1,520
Reputation: 25,000

Post » Sat Feb 09, 2013 7:24 pm

@ramones , i have tried but the weird thing is that has the same problem .

but i have tried to just write like this : my window width /2 , my window hight /2 so in action like this : 640/2 , 480/2 and its worked just fine but the problem in this : it need to re-fix in every windows so for every mobile if the game for mobiles .
the weird thing as i mentioned before is that when i write it like this : windowwidth/2, windowhight/2 it really doesn't do the job i have no idea why o.o ..

while i'm writing this post i have re-tried and put some text to see where is problem and i found that the window size change so thats why it keep getting new positions , also when i tried yours i always get sprite on 0,0 i don't know why ...

anyother thing can fix this??
B
45
S
15
G
6
Posts: 795
Reputation: 11,935


Return to How do I....?

Who is online

Users browsing this forum: Artpunk, Axiomaltd, MACPK, nicklowkcmagic, OddConfection, Yahoo [Bot] and 23 guests