Re-sizing Canvas Alignment Issue

Bugs will be moved here once resolved.

Post » Sun Apr 21, 2013 4:33 am

On exported projects, after resizing the canvas, the canvas aligns with the left side of the screen. Resizing the canvas works fine when testing the capx. The problem only occurs for exported projects (I've only tried it when exporting for an HTML5 website).

Link to .capx file (required!):
Example
Capx


Steps to reproduce:
1. Create an event that resizes the canvas
2. Export to HTML5 website
3. Run the exported index.html


Observed result:
The canvas aligns to the left side of the screen.

Expected result:
The canvas remains centered

Browsers affected:
Chrome: yes
Firefox: yes
Internet Explorer: yes

Operating system & service pack:
Windows 7 64bit
Windows 8 64bit
iOS

Construct 2 version: 126


    zatyka2013-04-22 18:30:07
B
44
S
13
G
7
Posts: 338
Reputation: 10,389

Post » Thu May 09, 2013 4:18 pm

Just wanted to give everyone a heads up that resizing the canvas still causes alignment issues in r129 when exporting to HTML5.

Also, if this is causing a problem for anyone else, a workaround is to display the canvas in an iframe. This is pretty simple to set up with r128's feature allowing you to export the game to HTML5 using the "embed" style.
B
44
S
13
G
7
Posts: 338
Reputation: 10,389

Post » Mon May 13, 2013 9:34 pm

@zatyka Yes, i'm having this issue too, maybe let's give him a time to fix this issue when he gets chance,
B
96
S
25
G
20
Posts: 3,055
Reputation: 22,646

Post » Wed May 15, 2013 12:28 am

@zatyka @Joannesalfa Have you tried in Build 130 yet to see if it was resolved?
B
49
S
11
G
10
Posts: 1,833
Reputation: 14,428

Post » Wed May 15, 2013 12:45 am

@BluePhaze Yes, it's fixed for windowed canvas, not fullscreen
B
96
S
25
G
20
Posts: 3,055
Reputation: 22,646

Post » Mon May 20, 2013 8:13 pm

@BluePhase

Sorry for the delay, I've been away on business. Exporting to an HTML5 website using the Normal style with r131 still causes the misalignment issue.
B
44
S
13
G
7
Posts: 338
Reputation: 10,389

Post » Wed Sep 04, 2013 1:42 am

@zatyka did you find a solution?
B
12
S
3
G
1
Posts: 347
Reputation: 2,866

Post » Wed Sep 04, 2013 1:54 pm

@ghost

I didn't find any solution, but I did work around the problem by displaying my canvas in a centered iframe rather than putting the canvas directly on the page. However, that only worked because I needed to change canvas sizes for a single tick to grab a screenshot of a specific size. After I took the screenshot, I would return the canvas size to normal (the size of the iframe). This method would not work well in most cases, especially when changing the canvas size is integral to gameplay. zatyka2013-09-04 15:27:56
B
44
S
13
G
7
Posts: 338
Reputation: 10,389

Post » Wed Sep 04, 2013 3:05 pm

thanks zatyka
B
12
S
3
G
1
Posts: 347
Reputation: 2,866


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 5 guests