How do I modify filechooser and force layout?

0 favourites
  • 4 posts
From the Asset Store
Build a thrilling space station scenario with these level assets and characters.
  • Hi guys, I am met with 2 issues today.

    1) For my filechooser object, I can hide it with opacity, or throw it off the screen, then execute a .click javascript on my sprite to open a filechooser. However, how do I make it so, similar to the button itself, when you choose a file, it shows the filename. IE: image.png <-.. What I plan to do is to have a sprite to serve as the container, and add a label inside the container, and on image upload, I'll set the label's text to the image's name, <- Anyone have any idea what's the action for setting the text to the image name or if this is actually achievable?

    2) How can I detect the layout of landscape? I want it so my game can only be played in portrait mode, but as I can't force a user to fullscreen, or have control over what browser they might be using (Safari doesn't support fullscreen). What I plan to do is if you're playing in landscape, I'll pause the game and have a sprite asking you to rotate your screen, once rotated it'll unpause the game.

    Thanks!

  • 1.

    FileChooser On Changed -> ButtonText set text to FileChooser.FileNameAt(0)

    2. You can try Browser condition Is Portrait/Landscape

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hey Dop!

    regarding the browserExec:fileChooserId.Click(); does not work on Safari (or Chrome for iOS), I have tryed also the CSS opacity 0... but also does not work...

    Any better way to be able to use FileChooser triggered from own Sprite?

    Thanks!

  • Try searching stackoverflow, there may be a different method to call .click() on Safari.

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