Idea: translating layout into event code

Discussion and feedback on Construct 2

Post » Thu May 22, 2014 7:56 pm

Hi,

I was thinking about a new feature today that might be useful.

Once a layout with all its object types is created, to support translating the layout into event/action code. The event/action code can independently recreate all elements in the layout with all properties. Such a feature could be in particular useful to reuse layouts.

Dan
B
8
S
4
G
1
Posts: 205
Reputation: 1,354

Post » Thu May 22, 2014 11:10 pm

you can just copy paste the objects from one layout to another... the feature already exist.
B
43
S
12
G
6
Posts: 446
Reputation: 6,802

Post » Thu May 22, 2014 11:18 pm

@Sargas You are completely missing @grossd idea. He want's all objects place and setup by hand on layout to create corresponding events related to their properties.
If you place object on layout at X50 Y60, then after some magic option you will have an event already created for you - Sprite: Set X50 Y60.
ImageImageImageImage
B
157
S
66
G
41
Posts: 2,597
Reputation: 34,821

Post » Thu May 22, 2014 11:29 pm

i did understand, but why would you need that if you can already just hand copy/paste anything in the layout?
B
43
S
12
G
6
Posts: 446
Reputation: 6,802

Post » Thu May 22, 2014 11:41 pm

I don't know, ask @grossd xD
Maybe if you setup you layout, and then in events you delete everything on start and recreate particular objects in same places after some actions. You would then already have events with all objects XY coordinates and other properties setup - instead of typing them in manually.
ImageImageImageImage
B
157
S
66
G
41
Posts: 2,597
Reputation: 34,821

Post » Fri May 23, 2014 12:50 am

@Sargas, you need it to work more efficiently.

Code you can for example put in an even sheet that you include in many other event sheets. For example suppose you want to have a HUD across all layouts, if you copy and paste it into say 20 other layouts, and then want to change somethign you need to go through all 20 layouts and make the change. With code its all in one place.

Dan
B
8
S
4
G
1
Posts: 205
Reputation: 1,354

Post » Fri May 23, 2014 1:17 am

but you can ALREADY do that. You could just code it once in it's own event sheet and then include that in any other event sheet that uses it.
B
43
S
12
G
6
Posts: 446
Reputation: 6,802

Post » Fri May 23, 2014 1:21 am

You can do that, but its tedious. Why not use a visual layout editor, and the press a button and it generates the code for you.

Same as copy-paste --- you CAN copy paste everything, and the change manually everything when needed. Its already possible, as you say; but its tedious and boring and error prone.
B
8
S
4
G
1
Posts: 205
Reputation: 1,354

Post » Fri May 23, 2014 1:56 am

I believe Ashley mentioned that importing a LAYOUT into another layout is on the to do list.

In the mean time. you can set your you HUD objects into a family. Set the HUD family to global. Pop to the HUD layout. Then proceed to whatever layout you want to. You now have your fully custom and modifiable HUD.

So when you need to remove your HUD, you can destroy HUDFamily.
B
90
S
18
G
9
Posts: 2,455
Reputation: 15,018

Post » Fri May 23, 2014 2:00 am

Thanks @jayderyu,

Yes, i know its on the todo list but its not high up there and from what Ashley says its a deeper change.

HUD is only one example. Global is a great feature when you want something across all layouts. Sometimes you want to be more selective, and reuse only across a number of layouts.
B
8
S
4
G
1
Posts: 205
Reputation: 1,354

Next

Return to Construct 2 General

Who is online

Users browsing this forum: stephanej88 and 13 guests