Hidden layers VS Layout

Discussion and feedback on Construct 2

Post » Sun Feb 10, 2013 8:38 pm

Developing a proper UI with several tabs, what does everyone think would be the more elegant/functional approach?

a. Hide and unhide layers, depending on what tab the user is trying to access.

b. Adding several layouts and switching between them through the use of buttons


b) would probably make it easier to browse through the code blocks or export only the parts of the application to JSON that the user chose, but a) does come with benefits as well (such as not having to duplicate the basic layout and thus saving on a few events).
B
6
S
2
Posts: 206
Reputation: 1,685

Post » Sun Feb 10, 2013 10:01 pm

Hmm, interesting conundrum. It really comes down to personal preference in this case.
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Sun Feb 10, 2013 10:11 pm

I so far cannot say which is the best model. However I can say what I did and will be trying.

my first model was to use multi pages, but I found I didn't like this at all. It seems redudant to keep on going through the load process just to see the credits. There was no speed issue, but just didn't seem so great. Works however and is the easiest to use.

my second model was to make a width or height * numberscreens. then just move the camera to the position. Works like a charm when using a single resolution. However it falls apart on multi resolution screen.s

my third try out is the multi layer. My concern though has to do with clicking on non-visible objects that C2 allows.
B
87
S
18
G
9
Posts: 2,455
Reputation: 14,834

Post » Mon Feb 11, 2013 2:27 am

Inverse of isvisble added to your conditions works great when using nonvisible layers and mouse on object clicked. Yes, it's one extra check, but it's a lot less work than trying to save the state of your game and switching to another layout.
B
26
S
8
G
3
Posts: 210
Reputation: 5,973

Post » Mon Feb 11, 2013 10:51 am

[QUOTE=theubie] Inverse of isvisble added to your conditions works great when using nonvisible layers and mouse on object clicked. Yes, it's one extra check, but it's a lot less work than trying to save the state of your game and switching to another layout.[/QUOTE]

Are you sure one would even need to save the state of a game?
Couldn't one simply use global objects (arrays, variables, etc)?

Either way, I think I'll need to scrap the idea of using layers. It would be way too messy and complicated for my editor suite.

For one, I want to set up V as a hotkey within the scene editor. While pressed down, this hotkey would remove (in terms of visiblity, not game logic) all buttons and only show the test character and the background scene (sans the blue lines seperating the walkable area from the one that is not).

I'd essentially need to split the layers at this point, which isn't that great either
B
6
S
2
Posts: 206
Reputation: 1,685

Post » Mon Feb 11, 2013 11:33 am

From what I understand, if you use multiple layouts, you will have no way of overlaying the menus (if that is desired) or having a transition effect from one to the other in which they're temporarily both visible at the same time. Also, I think you could make a simple function that makes one layer visible and hides the others. Actually, why don't we just try that...

https://dl.dropbox.com/u/117529592/Construct%202/Forum%20questions/LayerSwitchFunction.capx
B
6
Posts: 26
Reputation: 577

Post » Mon Feb 11, 2013 8:21 pm

[QUOTE=Blinx123]
Are you sure one would even need to save the state of a game?
Couldn't one simply use global objects (arrays, variables, etc)?
[/QUOTE]

When you switch to a layout, it resets the layout to it's default position...so any spawned sprites are gone, and if you've got a player actor they'll be back at whatever position you started them at. You're going to need to remember where everything is at and then set the scene back up again when you come back to that layout.
B
26
S
8
G
3
Posts: 210
Reputation: 5,973

Post » Tue Mar 26, 2013 8:58 pm

So it looks like I'm going to try the layer invisible thing myself.

Before I convert my layouts to a single layer (because I realized that it was going to be terrible to try to save (sprite objects) between layout switching back and fourth)

Has anyone learned something new or tips involved with single layout multi-layer interfaces?

Just checking before I pull my hair out later :)

EndoSkull2013-03-26 20:59:29
B
13
S
1
Posts: 17
Reputation: 946

Post » Wed Apr 03, 2013 11:22 pm

[QUOTE=EndoSkull]Has anyone learned something new or tips involved with single layout multi-layer interfaces?
[/QUOTE]

I spent the whole afternoon trying to do it and i got tired. Finally found a solution that works for my game.

Just... forget that! Just kick all your contents to a position outside the layout and then bring them into it again. Use families! (like "family.Y+100000")

-In some games it might just be the best and easiest solution.
I also did use Scale Layer and it worked marvelously well... until it didn't - and i dont know why.
B
8
S
1
Posts: 37
Reputation: 893

Post » Wed Apr 03, 2013 11:39 pm

I'm using the "one-layer-per-window" strategy for my game. Basically my game UI has a lot of in-game windows, each gets its own layer. Opening and closing these windows is a matter of hiding and un-hiding them at the clicks of buttons.

Persistent layout is a very recent beta feature I hear, after I'd already be done with my set up. I might try messing with that for UI management in another project.

There's also the UITemplate plugin that I forgot to try out.
B
19
S
6
G
1
Posts: 116
Reputation: 2,730

Next

Return to Construct 2 General

Who is online

Users browsing this forum: spacedoubt, Unconnected and 2 guests