Valhalla.admin's Recent Forum Activity

  • For the last couple of days I have been seeing the following errors during export:

    There is an internet connection. Changing the Internet provider also gave a positive result.

    Successful export turns out to be done somewhere from the 20th time.

  • This could do the trick

    > 
    alert(navigator.userAgent);
    alert(navigator.appName);
    
    navigator.__defineGetter__('userAgent', function () {
    return "Prince Pie"
    });
    navigator.__defineGetter__('appName', function () {
    return "Mehlicious"
    });
    
    alert(navigator.userAgent);
    alert(navigator.appName);
    
    

    The code I've suggested does a great job of making changes to the userAgent.

    Your version of the code also makes changes to the userAgent.

    But the construct ignores the user data in the userAgent and uses others:

    whatsmyua.info

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I don't think browsers actually allow this. I think it could cause a lot of compatibility and security issues if pages could arbitrarily change the browser user agent.

    If you want to specify some extra data to handle on the server side, usually you'd do that with query string parameters or POST data.

    Changing the name in the userAgent is a common practice, for example, almost all bots use it.

    Then you can configure the rules on the nginx server itself.

  • Tell me, how can I change the userAgent when opening a site in iframe? It is very necessary to add specialized information for processing on the server side.

    Previously, I was able to use this code, but it didn’t work in the Construct:

  • Use the system viewport expressions to identify the middle of the visible area taking in to account scrolling, scale etc. You must pass a layer to take in to account the layer transform. (ViewportLeft("Layer 0") + ViewportRight("Layer 0")) / 2 will the X co-ordinate of the middle of the screen for "Layer 0", and (ViewportTop("Layer 0") + ViewportBottom("Layer 0")) / 2 the Y co-ordinate.

    Thanks, you've been very helpful.

  • Is there a universal way to find the center of the screen, e.g. horizontally to display a button?

    There is a button with options:

    Button.width = 400;

    Button.height = 50;

    Origin = Top-left;

    So when using this formula, the button is not always displayed in the center:

    Button.X = PlatformInfo.CanvasDeviceWidth / 2 - Button.Width / 2

    how to determine the center of the screen of any device?

Valhalla.admin's avatar

Valhalla.admin

Member since 2 May, 2021

None one is following Valhalla.admin yet!

Trophy Case

  • 3-Year Club
  • Jupiter Mission Supports Gordon's mission to Jupiter
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

7/44
How to earn trophies