[Request]Using layer name directly

Discussion and feedback on Construct 2

Post » Sat Feb 02, 2013 5:16 pm

Hi admin,

I try the beginner tutorial.
Layer 0 is background.
Layer 1 is Main.

When we set event details, we use layer 1 instead of Main.
Why not using the layer unique name "Main" directly?
If we rearrange the order of layer, the event details still use layer 1 which become background.

Request:
1. use layer name directly (recommended), or,
2. whenever we re-arrange the order of layer, C2 will search through all details and replace with correct layer automatically

Similary, could we give image point a meaningful name? eg. front / center/ etc.

Thanks for attention.
sammyconstruct2013-02-02 17:17:44
B
5
S
1
Posts: 39
Reputation: 703

Post » Sat Feb 02, 2013 5:44 pm

You can use "layer name" in expressions
ie.

Sprite: Move to layer "Main"

Same with image points, You can use string for image points.
ImageImageImageImage
B
140
S
58
G
36
Posts: 2,547
Reputation: 31,170

Post » Sat Feb 02, 2013 5:49 pm

You can use the names directly, you just need to put them in quotes in your events to use them. Works fine for me. Set Layer to "Main" works just fine.

Ah, @Shinkan got it in before I did...BluePhaze2013-02-02 17:50:13
B
49
S
11
G
10
Posts: 1,833
Reputation: 14,428

Post » Sun Feb 03, 2013 12:23 am

His request #2 is still valid though

"whenever we re-arrange the order of layer, C2 will search through all details and replace with correct layer automatically"

I also had to spend some time to fix errors after rearranging/adding/renaming layers because of this
lemo2013-02-03 00:25:10
B
20
S
5
G
8
Posts: 325
Reputation: 6,473

Post » Sun Feb 03, 2013 12:42 am

Thank you.
[QUOTE=BluePhaze] You can use the names directly, you just need to put them in quotes in your events to use them. Works fine for me. Set Layer to "Main" works just fine.
[/QUOTE]
I will try to check this because tutorial informs us to use number.


[QUOTE=lemo] His request #2 is still valid though

"whenever we re-arrange the order of layer, C2 will search through all details and replace with correct layer automatically"

I also had to spend some time to fix errors after rearranging/adding/renaming layers because of this
[/QUOTE]

This is very time-consuming and error-prone!!!

Please consider this request.sammyconstruct2013-02-03 00:46:20
B
5
S
1
Posts: 39
Reputation: 703

Post » Sun Feb 03, 2013 12:59 am

@Lemo @sammyconstruct

If you use the string name of the layer (not its number) ordering the layers again still works.

Considering your example :
Layer 0 is "Background".
Layer 1 is "Main".

If you refer in your code to the layer "Background" (not 0), changing the order of the layers to
Layer 0 Main
Layer 1 Background

Already keeps the correct "link" to the layer ("Background" is "Background" whether it's layer 0 or layer 1)

Or have I misunderstood what you're talking about ?
If so please give more details and precise steps considering your issue.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 7,000
Reputation: 57,795

Post » Sun Feb 03, 2013 1:39 am

Hi Kyatric ,

Exactly. I got it now.

I think the problem that lemo mentioned related to number instead of string. Using string solve all problems. I will double-check this.

Please update the beginner tutorial to use string because the new users will have bad habbit at the beginning for using number. They should start with right habit. String must be used as default standard.
sammyconstruct2013-02-03 01:43:06
B
5
S
1
Posts: 39
Reputation: 703

Post » Sun Feb 03, 2013 1:42 am

@Kyatric
[QUOTE=lemo]I also had to spend some time to fix errors after rearranging/adding/renaming layers because of this
[/QUOTE]

I was talking about layer numbers for the "rearranging/adding" issues
And layer names for the "renaming" issue
So there's still a problem in both cases
B
20
S
5
G
8
Posts: 325
Reputation: 6,473


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 18 guests