i created a new empty template, changed the resolution for the layouts to 1920x1080 and the template screen till here all good, until i create a sprite and try to automatically place it on start in the center of the screen based on the window.height/2... window.width /2 ... as simple it sounds... there is a displacement... not sure if this is because of the browsers or not but problem persists on chrome, firefox, internet explorer and even NW.js
the capx also includes 2 other sprites i used to determine the actual WindowHeight WindowWidth center...
also another note : i tried another test placing the object to the center of the screen by first taking the ViewportRight("0") then subtracting WindowWidth/2 of the curent position.
it seems instead of - the system does a +
for that i have no capx .
since the method is a bit unusual and i just need the WindowWight WindowHeight expression to work for my capx.
Attach a Capx
____ Upload a Capx to this post ____
Description of Capx
____ Concise description of what this CapX does ____
the capx is a new empty template, that has 2 lines of codes to automatically position a newly created sprite.object based on WindowHeight/2 WindowWidth/2 system expressions.
Steps to Reproduce Bug
- Step 1 create a new empty template
- Step 2 set the resolution or screen size to template and layout to 1920 width 1080 height
- Step 3 create a new sprite object
- Step 4 set the position of the new created sprite object using the set_position expression to x:WindowWidth/2 y: WindowHeight/2
on my testing i added a text object to get the WindowWidth and WindowHeight and the valuesof WindowWidth and WindowHeight divided by 2.
it seems the windowHeight is not 1920 x1080 but 1644 x 925 .
sprite to be positioned to the exact center of the screen that is initially set ie. 1920x1080
- Chrome: (YES)
- FireFox: (YES)
- Internet Explorer: (YES)
- NW.js: (YES)
Operating System and Service Pack
Win8.1 Enterprise N x64 bit
Construct 2 Version ID
____ r227 stable 64-bit version ____