[EXPLAINED] Auto Scale TextBox Font From Desktop To Mobile

Get help using Construct 2

Post » Fri Aug 05, 2016 6:04 pm

When previewing my game on desktop everything is fine. When i preview it on mobile, the textbox scales down and either 1 of 2 things happen: the font is incredibly small or it stays the same size as the desktop, which makes it useless on mobile.

I've tried many different actions. Followed the few examples and tutorials that are available. But nothing works.

I am using css style for the box:

Image

and i've messed around and changed settings, actions, many things, still nothing.


Any help is greatly appreciated.
Last edited by jeffige on Sun Sep 18, 2016 3:01 am, edited 1 time in total.
B
38
S
18
G
19
Posts: 664
Reputation: 14,107

Post » Fri Aug 05, 2016 7:43 pm

I figured it out. Took several events/actions but it's working nicely now.
B
38
S
18
G
19
Posts: 664
Reputation: 14,107

Post » Sat Sep 10, 2016 3:00 pm

@jeffige
Hi,
Care to share your solution? I like many others are trying to resolve this issues. Thanks in advance.
B
15
S
2
Posts: 27
Reputation: 1,229

Post » Sun Sep 18, 2016 2:17 am

Hey brother, sorry for the late reply.

I created 2 textboxes. 1 for desktop and 1 for mobile. It takes a lot of adjustments cause you may (as i did) have both textboxes in the same exact place.

First, get the desktop correctly positioned and write down the position. Move that out of the way and forget about it for now. Then create the mobile textbox. Refine the look and size of the box and font size using set css style in event sheet. Like i said, there are a lot of edits here.

Once you have it exactly how you want, reposition the desktop textbox using the position you wrote down earlier.

Then just do it like you would with showing or hiding mobile controls on desktop.

Have the user touch (mobile) or press (desktop) a button... Like ENTER or something else. Then in the event sheet > if mobile > set desktop textbox invisible and disable, and vice versa if on desktop.

If you have problems, let me know.
B
38
S
18
G
19
Posts: 664
Reputation: 14,107


Return to How do I....?

Who is online

Users browsing this forum: brunopalermo, dop2000, RODInteractive and 35 guests