[EXPLAINED] Auto Scale TextBox Font From Desktop To Mobile

0 favourites
  • 4 posts
From the Asset Store
Forget about default textbox restrictions, you can create sprites atop of the textbox
  • 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:

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

    Any help is greatly appreciated.

  • I figured it out. Took several events/actions but it's working nicely now.

  • jeffige

    Hi,

    Care to share your solution? I like many others are trying to resolve this issues. Thanks in advance.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)