JMKit's Forum Posts

  • If you MUST have multiple layouts, I would try making your little rabbit sprite global first. If that doesn't work, then you get to use an array/hash object and track all of the positions on screen of every object that you want to exist on multiple layouts and repopulate the screen each time you change layouts.

    lol yes I MUST! this is just a small isolated element of the overall project, separated so I could focus on it specifically, but ultimately I'm re-creating a game I made in flash ( http://www.jmkit.com/playsets/ ) while also adding new features that Construct will allow, and If you see the video posted below, you'll see its so close to how I'd like it to be it's just one element that seems like a tiny variable / iid or something away from perfect..

    Can you post a capx or video of the issue in question? This is obviously in need of a more in depth analysis.

    I did include the capx in al link in my previous reply, but it'll be clearer with a video (I show the code to the right and a debug view of the variables etc)

    VIDEO:

    Subscribe to Construct videos now
  • Wen you leave a layout, everything is destroyed unless it is given the Global property.

    The character is persistent and stays on the layer you drag him out / away from the 'bottom bar' a variable says he's out and lets him stay in that layout when leaving and returning

    I don't think you can.

    Maybe destroy the object on exiting laytout 1 and recreate it later as needed?

    Would these need code for every layout to save a position of a character if the variable for it says it's out (up from the menu bar)

    I'll share this link so you can see what's going on so far:

    http://www.jmkit.com/html5/testproject/index.html

    Things to bare in mind:

    • You can click and drag the character out to one place (say blue) - leave and he's still out, go back to blue and is in the position you put him...

    you can then drag him back to the bottom where he'll pop down and stay there through all the layouts.

    every button goes to a new layout

    However, the problem comes when say you drag him out in the blue place - then go to the green place and click the outline to bring him back down, then immediately drag him out to the green place he'll be in both the green and blue place <img src="{SMILIES_PATH}/icon_e_surprised.gif" alt=":o" title="Surprised"> (that goes for any variation on place to place, you can get him out in all 3 layouts with that method)

    The resetting him from a layout he's not on seems like the only issue i'm having.

    Thanks for your replies so far!

    check out how i'm doing it code wise here: https://www.dropbox.com/s/6w3hkgdfmlf7e ... .capx?dl=0

  • If I press a button to create a new Object (sprite) on layout 1 then move on to layout 2, How would I have a button destroy the instance I created on Layout 1 so that when I go back it's no longer there.

    Thanks for any advice

    *edit* btw, I'm using persistent sprites that i want to choose if they are onscreen on layout 1 or 2 but not both at the same time. thanks

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hopefully someone sees this *fingers crossed*

  • I can also share the project file if it helps: https://www.dropbox.com/s/6w3hkgdfmlf7e ... .capx?dl=0

  • Ok this might sound complicated but hopefully makes sense:

    My idea / setup is:

    • I have an area at the bottom of the screen with a drag and drop character
    • I have 3 areas that I want to drag a character out too
    • I made the character persistent so that if I leave a layout, the character stays in that layout when I later return to it

    My issue is:

    I am able to drag him out and have him stay put with the code I'm using right now,

    however to bring him back to the bottom area (for dragging out somewhere else later) I click a placeholder and he returns (whatever layout i'm in) BUT here's where it goes wrong...

    Say i'm (in this example) in Green Place, I drag my character out and position him anywhere in that layout... Then click and go to Blue Place, he's not there - which is what i want, and when I click the placeholder he pops back to the bottom area in that layout - which is also what i want, however If i then drag him out to Blue Place and go back to Green place, he is out twice in whatever positions i put him in..

    I'll add the code to hopefully show what I'm trying to do:

    'PutAway' is the bottom area / menu.

    As you can see in here i've got most of it working thanks to the characters id 0 or 1 and i feel like i'm one or two tweaks away from having it exactly how i want, just missing that final peace! any help would be appreciated!

  • Thanks for the quick reply gumshoe2029!

    I'll use that method for now, is there no sign of this becoming a more user friendly option in future releases?

    Would be nice to export and import within the program.

    Still thanks again

  • Hi,

    Sorry if i'm missing something obvious, but is there a way to share or save (for example) a character you've made in one game for use in another?

    I've tried simply copying and pasting a sprite between projects but it seems to only copy frame 1 of a sprite and doesn't copy the animations along with it. (I know the coding won't move along with it, but that seems easy to copy and paste across)

    Also if you've put a character together with multiple sprites pinned together is there any way of exporting that whole creation.

    Thanks for any advice

  • scirra.com/forum/viewtopic.php

    Very nice, thanks!

  • Ahh, well hopefully something can come up soon then

  • Is it possible to take a snapshot image of only a specific width and height of the overall canvas?

    Thanks for any feedback

  • Ah ok cool, thanks for the feedback!

  • You can make a sprite called "hat" and pin it to your characters head. Then you can make many different frames inside the hat sprite with different type of hats and set the animation speed to 0. Then you simply change hat type by selecting different animation frames.

    This method can be used for many different things as well.

    Thanks, would that also work for more complex clothing with animations such as shirts that would need to move in the arms along with the character?

  • Hi all,

    So coming to Construct 2 from Flash, I'm fining my way around new ways of doing things, in this instance I'm trying to change elements of a characters clothing.

    In Flash I would use movie clips within movie clips if I wanted to (for example) change a characters hat from a red cap to a blue top hat, I could do that just by changing the hat movie clip inside the character's movie clip and that way it would change the hat whatever position / animation the character then went into..

    So I'm just curious if there's anything like that in construct, having a sprite inside a sprite O_o or just a whole other way this kind of thing could be achieved - or does it literally just have to be whole new images for any change like that.

    Thanks for any feedback

  • [quote:37qytk0g]Would adding a condition on drag and drop start if sprite is on layer "blabla" (layer is invisible) drop sprite work?

    I tried this:

    For some reason this stops me dragging it out at all O_o