Canvas, Layout, Window, and While loops...oh my!

Get help using Construct 2

Post » Wed Mar 27, 2013 11:04 pm

I'm trying to run an experiment where the window size - I presume that's the view of the overall layout - is gradually resized right there in the browser window.

For instance, if the width of the window is 500 pixels, I want to gradually made that width expand...501 pixels, 502 pixels, 503, 504...until I reach a certain value.

My first question is simply what is the difference between the "canvas", the "layout", and the "window". As I said, my understanding is that the layout contains the whole of the current level or room or HUD. The window, however, is what can be SEEN of the layout at any given time, whether in part or in whole. But in the C2 editor under System, it mentions the canvas. Is that a reference to the layout, the window, or is it entirely something else?

Per my experiment, I put in the Event tab:

SYSTEM On start of layout (This I tried both toggled on and off...)
SYSTEM While
SYSTEM WindowWidth < 1250
--> SYSTEM Set canvas size to WindowWidth+1 x WindowHeight


The initial layout size is 1280x1024.
The initial window size is 800x480.

Again, I want to try to make the window through which the game is viewed to perceptably widen until it reaches my desired value. Like a window the size of a box, for example, expanding to that of a rectangle.

Running the layout only left problems...rather, it didn't actually load. Certainly not as I hoped. I didn't even see a window in the first place.

Another problem I have is that a different test using the While loop seems to complete instantaneously even when I add that Wait 1.0 seconds action into the mix while the condition is still true. I wanted a variable to increment by 1 while the value was less than 500, adding a one-second delay between increments, and to display the value of the variable immediately after each increment. AND! Even after adding a 10-second delay at the start of the layout before the While event still yields a text display for the variable's value as 500, or even 5000! I see no increment progression...even a fast one. Just instantaneous.

Can someone help me clarify what the differences are between canvas, layout, and window are (if I'm at all mistaken), and give me a hint/direction on how to accomplish my goal, please? Just a hint...I still need to learn this on my own, too. And to explain to me the nature of the While loop as it's in action?

Thank you so much!!Rhindon2013-03-27 23:41:21
I'm seeking Narnia. Who wants to come with me! Aslan is on the move!
B
112
S
20
G
8
Posts: 741
Reputation: 13,636

Return to How do I....?

Who is online

Users browsing this forum: LaroTaio and 2 guests