How to set 'margin-top: 0' at new setCanvasFillMode + setCanvas [SOLVED]

I cannot make the top fit at
When pressing “Udfyld” the screen is supposed to fill - and it does, but not in the top where some weird CSS-thing from initial fixed resolution seem to be ‘carried over’ ->> the same upper edge remains in place?

Udfyld.prototype.onPress = function (event) {
   // event.element.textureAsset = this.activeAsset;
 var app =;
    if(this.udInd ===false){   this.udInd = !this.udInd;     
                           } else{ app.setCanvasFillMode (pc.FILLMODE_NONE);  pc.RESOLUTION_FIXED(960,540); this.udInd = !this.udInd;}

PS: The camera view also changes at button-press (looks bug-like)

If you are having troubles with fullscreen mode look at this topic might help in the mean time i will try clarifying how to fix it

Also @Thomas_Due_Nielsen this could help you get an ideas of what you may not have put in… As well im still looking to see what the problem is… Have you tryed console.log?
Also there is this topic as well

Thanks Nathan, but I have already been within fillmode-area … this is more CSS-related to how playcanvas chooses to render in relation to an overlay HTML and/or mostly when going back and forth between

Ah ok i will look into that… if you move towards pc.RESOLUTION_FIXED in my opinion that would be harder because of the natural device itself might not be able to tell where to put the canvas

Quitting this subproject in my bigger, as the function is not platform-penetratable on all browsers (will link to “fillmodes full”-pages and/or with “Works on Chrome” etc). But thx Nathan anyway

1 Like

Dont make quitting a habit i liked what you do with your projects keep up the work!

Hey Nathan - can see your point. If I was in a better position, I would move/force the big tech-companies into making “the function platform-penetratable”. But one of my big visions with PC is that it is 98% platform-penetratable through the WebGL-part of it.

Unfortunately this does not apply to the JavaScript-to-HTML-part, as in this case where some browsers allows fullscreen, and others not - I found out this late in the process (after instantiating this post). Links to “fillmodes full”-pages is the best of lesser alternatives.

1 Like