Hidden layers VS Layout

0 favourites
  • 10 posts
From the Asset Store
Make your game more fun and interactive with the Dog Hide and Seek Buttons Sprite Sheet.
  • 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).

  • Hmm, interesting conundrum. It really comes down to personal preference in this case.

  • 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.

  • 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.

  • 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.

    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

  • 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...

    dl.dropbox.com/u/117529592/Construct%202/Forum%20questions/LayerSwitchFunction.capx

  • Are you sure one would even need to save the state of a game?

    Couldn't one simply use global objects (arrays, variables, etc)?

    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.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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 :)

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

    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.

  • 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.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)