How do I

Get help using Construct 2

Post » Thu Sep 17, 2015 11:47 am

Hello guys, please does anybody know how to go from one layout to another layout ? Thanks
B
6
S
1
Posts: 44
Reputation: 484

Post » Thu Sep 17, 2015 11:52 am

event sheet
action: system -> go to layout
B
12
S
1
Posts: 63
Reputation: 633

Post » Thu Sep 17, 2015 12:02 pm

Do u an idea of a capx to do that? because I know it involves instance variable ,botton and event.
B
6
S
1
Posts: 44
Reputation: 484

Post » Thu Sep 17, 2015 1:43 pm

Image
B
17
S
7
G
7
Posts: 205
Reputation: 5,335

Post » Thu Sep 17, 2015 4:05 pm

thanks, but I can't view the image u posted.anybody with another idea I will be glad.
B
6
S
1
Posts: 44
Reputation: 484

Post » Thu Sep 17, 2015 4:12 pm

joeb12 wrote:thanks, but I can't view the image u posted.anybody with another idea I will be glad.


What's wrong with the action:
system : go to layout...?

The only action you need is the above, the event and or conditions are up to you to decide..

You want to use a button?
on button pushed - system go to layout

If there is more to your question, it would be helpfull if you explained..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Thu Sep 17, 2015 4:22 pm

[email protected] stain, I intend to use botton but am confused about the instance variable of the botton in the layout,I understand the event aspect.
B
6
S
1
Posts: 44
Reputation: 484

Post » Thu Sep 17, 2015 5:04 pm

What instance variable do you mean?
Are you using some kind of template or following a tutorial?

An instance variable isn't needed, but you could ofcourse give the button an instance variable..
In that case I would go for text and input the name of the layout you want the button to refer to as the text/string
Then you could use the action goto layout by name : button.instancevariable
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Thu Sep 17, 2015 5:50 pm

personally i use make layer invisible, and disable solids (on have a on layer visible event)
(by this i mean have an event for each layout visible/ invisible that sets things on the layout to solid enable/disable)

so when you (if its an rpg style map movement system) on collision with the next layout sprite, make the current layout invisible, make new layout visible and then set position of player.

made a good town to wild game with this, also transfers to battle system layout lovely, while holding the players current location! :) (ps disable player movements if u are using it for a battle system)

i got bored so like most things went into making something else after.

hope this helps
B
9
S
3
Posts: 113
Reputation: 1,009

Post » Fri Sep 18, 2015 9:36 am

Message: DayDream can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
You can just leave the "instance variable" of the button on its properties. If you want to use a button to go to another layout I think this should be it.

Scenario: Layout 1 with Button1, Layout 2

Event sheet of Layout 1
condition: button1|on click
action: system-> go to layout -> Layout 2 (Go to Layout 2)

here is a sample of that:

https://www.dropbox.com/s/ihttjidq3b8zb1s/sample.capx?dl=0
B
12
S
1
Posts: 63
Reputation: 633


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 6 guests