A Creation Screen?

Get help using Construct 2

Post » Thu Oct 17, 2013 7:11 pm

So my project is coming along nicely but i have decided to add a creation screen for name/age/gender/race.

My question is, How do i have it so, a person enters name, types in an age and it saves it to a variable, To which it then displays it on a seperate char sheet.

I can manage the gender/race since i am using checkboxes for those.

Thanks in advance
B
5
Posts: 13
Reputation: 227

Post » Thu Oct 17, 2013 8:03 pm

Create a global text variable for name and a global number variable for age. On the layout, you can use a textbox object for input of name and age. Then save when a button is clicked.

Here's a quick example w/ some comments to explain it. It's a little more complicated than it needs to be, but it illustrate some tricks about re-using objects instead of making unique clones for every need.

Example: https://www.dropbox.com/s/hj5ir6j8ng055y4/sheppard1.capxScavengrove2013-10-17 20:04:00
B
7
S
1
Posts: 20
Reputation: 388

Post » Thu Oct 17, 2013 9:46 pm

Well i already have the variables :D

The textbox is already placed for both name and age, aaand Finally xD thankyou.


p.s how do you add the grid , i'm always struggling to line things up
B
5
Posts: 13
Reputation: 227

Post » Thu Oct 17, 2013 9:52 pm

View tab - tick boxes for 'snap to grid' and 'show grid'
B
8
S
2
G
1
Posts: 45
Reputation: 1,007

Post » Thu Oct 17, 2013 11:31 pm

So For some reason it wont load the variables into the text fields located in layout character screen, I have Double checked everything and think maybe i am just blind, because i cant see anything.

if you could take a look at my capx, andTell me if you can see the reason, the creation page info does not carry over. (name,age,race,gender etc)

Also let me know what you think of my first attempt at making a integrer game xD

Linkies to the capx file,
https://www.dropbox.com/s/2tasr60zog5grnj/Test.capx

p.s It loads the variables, but the entered variables do not save, narrows it down but still cant see it.sheppard12013-10-17 23:32:02
B
5
Posts: 13
Reputation: 227

Post » Fri Oct 18, 2013 2:12 am

Wow, you've put a lot of work into this! There are a lot of things to talk about that will help you out:

1) Your capx is 180MB, which is enormous. The reason is your backgrounds are 4250x3500. However, in the game you have them scaled down to 648x487. Instead of scaling them, resize the actual image (in the editor or paint or something). The game already has noticeable lag because of the huge images, it's an easy fix and will avoid negative performance problems down the line. For future reference, it is far better to create your backgrounds from their individual components (tiled textures with sprites on top, for example) than to have the background be one giant image.

2) You can reduce your layout sizes to the window size of the actual game by clicking on the layout objects in the project list. On the property sheet for the layout (left side of the screen by default) you can adjust the layout size to 640x480.

3) For your input fields (name, age, etc.)- You don't need the instance variable 'control' if you're going to clone a new object type for every single button/list box/text field. The object is unique, so the events referencing them only ever apply to that single object.

However, you can use the same object in multiple places (like in my example I sent.) If you do that, use an instance variables to differentiate between multiple occurrences of the same object. Make sense? I cleared out the instance variable from each object and put the actions for each text/list box together on one event and it worked fine.

Like this:

Hope this helps!Scavengrove2013-10-18 02:45:29
B
7
S
1
Posts: 20
Reputation: 388

Post » Fri Oct 18, 2013 11:29 am

Thankyou for the tip on image sizes, I didnt even notice lol :D but thats a 75% reduction in size so far.

And yep that works.

I have to say, you sir have just made things soo much better for me xD and the speed it now loads yay :P

Also: I notice sometimes The screen goes black for no reason, Is this normal or does it have a cause, you normally have to click around till you hit one of the buttons.
B
5
Posts: 13
Reputation: 227

Post » Fri Oct 18, 2013 2:21 pm

The black screen is a Firefox issue if you have nothing changing on your layout:
http://www.scirra.com/forum/bug-render-problems-in-firefox_topic76759_post459687.html?KW=text+firefox+bug#459687
B
55
S
29
G
19
Posts: 1,520
Reputation: 25,680


Return to How do I....?

Who is online

Users browsing this forum: angryscientist and 26 guests