Grimmy's Forum Posts

  • I have a html element which covers the screen. It has a wrapper css as in the example:

    position: absolute;
    	left: 0;
    	top: 0;
    	right: 0px;
    	bottom: 0;
    

    However, when I run on android the html element is either offset to the left or clips out at the right of the device screen.

    I have the top bar turned off on android export but I see this issue even with it switched on.

    Everything looks perfect in preview. Its fully responsive when I manually adjust the widow size in the preview.

    Any ideas how to get the preview to match the export?

    I have attached an image so you can see the differences between the preview and device build.Note the buttons at the bottom and the whole html element is offset about 10 pixels to the left..

    EDIT: When doing a remote debug I can see there is a left:-5 offset in one of the construct divs (not mine) See image.

    Thanks

    Tagged:

  • I can style the list object itself using a class or id and I can also access the option elements within the list to style them. However, when I do something in CSS like

    #my_dropdown option{
    
    background-color: #FBCB2C;
    margin: 50px 0;
    
    }
    

    The background colour of each list item is affected but the margin parameter has no effect. I notice that the list is of class 'select' but whatever I try I cant seem to change the distance between list items.

    Basically I want the list item to be easier to use for mobile users and the current spacing between items seems too narrow.

    Cheers

    Tagged:

  • Ah I found it.

    Create a HTML element and then as an action in your events sheet choose "Create sprite as image Element"

    Cheers

  • Hi Ashley. What does that mean exactly? How do I do this? Do I need to create a HTML Element for this?

  • For example, I have a whats app icon which I am currently getting from a Fontawesome url at runtime and I embed in my html like this:

    <i class="fa fa-whatsapp fa-1x"; style="color:white; padding:5px;";></i>
    

    However, I want to use a local file from my project so that the users can see it if they are offline too.

    How can I embed a local image into my html?

    Something like this>>? ..but how exactly do I reference to image??

    <i class="myLocalImage"; style="color:white; padding:5px;";></i>
    

    Tagged:

  • I did notice that the iFrame is not the issue.

    Even if I tried to call the Whats app link through my own js/html the link would still fail. (I tried with all targets _blank,_self,_parent etc)

    However, if I make a js function call to my event sheet which in turn opens the URL then the link opens correctly.

  • The solution to all this was to put my list.js file into the files folder and NOT the scripts folder. Everything works now just as it does in the preview.

    I have no idea why though.

  • From what I can tell through some debugging is that one of my scripts (list.js) never gets loaded (in the built apk version only).

    I've tried adding a Main Script (set as main script) with just the single line:

    import "./list.js";

    ..but still content in the list.js script doesn't seem to run.

    I get the error in remotote preview:

    c3runtime.js:2801 Unhandled exception running script Event sheet 1, event 2, action 6: ReferenceError: List is not defined

    As I said, it all works perfectly well in the preview but not in an exported apk.

    UPDATE:

    I think I managed to force the script to load but now in the apk build it just hangs on the loading screen (presumably when the script loads). There is no information at all in the Chrome remote inspector so I have no idea what the error is.

  • I tried everything and in the end I'm having to re-create the content of the iframe inside C3 as new html just so this will work properly.

    Not sure its the best way to go but I couldn't find another solution.

  • Hi. My project has a lot of html. Everything works fine in preview and in remote preview but when I export an apk the html doesn't display. It looks like maybe either/or/and:

    • my javascript file (in the scripts folder) isnt running/loading
    • my css file (in files folder) isn't being read/loaded
    • my html file in my files folder isn't being read/loaded

    One or all of those things Im guessing.

    Do I need to force the import/load somehow?

    Shouldn't it run exactly the same as the preview?

    Or maybe there are some other ideas?

    Cheers

    Tagged:

  • Thanks, the iFrame is working correctly so its an issue when clicking the button within the iFrame. I tried those suggestions but I'm still way off getting it working. (For a start a cant even access the iframe buttons via script..when I use getElementsByClassName on my iFrame I just get a returned array of length:0)

    As for changing the link, the problem is the link is something like "https://wa.me/1234567890" and its embedded into a google sheet. If I edit that link to something like:

    wa.me/1234567890 (with ?target=_blank appended)

    The link still takes me to the "Looks like you dont have Whats App installed" page on a built APK.

    I also tried ?target=_self but it has the same result.

  • Thanks, unfortunately I still can't seem to get an array of elements using the following:

    let elements=iframe_main.getElementsByClassName('sv-tile__btn sv-link-reset is-primary') ;

    It just returns a collection of length 0 even though I know there are about 20 elements of this class on the iFrame page.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Specifically, when a button is clicked in the iframe I want Construct 3 to perform a task. I know the class of the iframe button and the data in its href.

    I looked at a few iframe tutorials but they seem to be sending messages from construct to the iframe and not vice versa.

    Any ideas?

    Tagged:

  • I made some changes to my original post so I hope you don't mind me bumping this. I have a clear disparity between remote preview with iframe links and a debug apk.

    I'm sure it must be some kind of iframe parameter I need but I have no idea. Can anyone help?

    Thanks

  • It worked again the following day once, but now its dead again. Seems to be 'sporadic' at the moment.(24/12/2022)