How do I make login page in my project

Get help using Construct 2

Post » Mon Jul 13, 2015 6:56 am

hello i need some help for 2 questions.
example
layout1 Start manu ------> layout2 create hero(in put name) -----> layout3 play (show name of hero)

layout1 Start manu -----> layout3 play hero as ----> save

1. i try to make login page in my project. by type hero name in textbox on layout2
and i need the name of hero show on layout3 for save data.

2.on layout3 after tap finish it will go to layout1 . when i tap next bottom. i want to skip layout 2 then go to 3.
i no need to goback to layout2 again

sorry my english is not good
thank you
Last edited by nitawat on Mon Jul 13, 2015 9:13 am, edited 2 times in total.
B
7
Posts: 23
Reputation: 315

Post » Mon Jul 13, 2015 8:45 am

The best way is probably to have a global variable called "heroName" which is initially empty. In layout 1, only go to layout 2 if this is empty, otherwise go to layout 3. Obviously copy it in in layout2, and because it is global it is available to use in layout3.
My tutorial through development blog is at http://myconstruct2dev.blogspot.co.uk/
B
12
S
3
Posts: 221
Reputation: 1,328

Post » Mon Jul 13, 2015 11:39 am

thank you for your answer
but i still can not understand the process for it work
B
7
Posts: 23
Reputation: 315

Post » Mon Jul 13, 2015 11:46 am

If you would like the name saved, so it will be used if the program is closed and restarted, you should use local-storage..

Without that it would be in pseudo-code:

on layout1 you have a button play..

on button play pressed
-- if global variable heroname is not ""
> goto layout 3
-- else goto layout 2

on layout 2 you have an input field and a button ok

on button ok pressed
> set global variable heroname to inputfield.txt
> goto layout 3
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 » Sun Jul 19, 2015 1:49 pm

thank you LittleStain i try to do it :)
B
7
Posts: 23
Reputation: 315


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 14 guests