Thursday, February 29, 2024
HomeGame DevelopmentHow Recalc Internet Cocos Surroundings(Javascript) - Cocos Creator

How Recalc Internet Cocos Surroundings(Javascript) – Cocos Creator

iOS Safari Fullscreen Downside.

  1. scroll up safari brower
  2. conceal handle bar
  3. cocos creator canvas change display screen ratio (scale up (up and down)) not regular
  4. i would like refresh change display screen setting apply (design ratio)


I Need Div’s contact Occasion → ship Cocos Creator

code not working.

perform ProcTouch(evt){
let cv = doc.getElementById(“GameCanvas”); = window.innerWidth+‘px’; = window.innerHeight+‘px’;
window.addEventListener(“touchstart”, ProcTouch);
window.addEventListener(“touchmove”, ProcTouch);
window.addEventListener(“touchend”, ProcTouch);

Plz Share your data

Hello, the issue is as a result of the engine aspect handles the contact occasion registered by window.addEventListener and stops the occasion from effervescent upwards, thus making it invalid.
Means 1: is to customise the engine (by modifying the code in that half and compiling the engine).
means 2: after constructing, by modifying the engine supply code after constructing.

However I made a decision to do it one other means
Sometime I’ll use the best way you talked
I feel my downside is totally different now

I discovered api


canvas dimension change – okay
contact place – totally different

i would like change dimension cocos creator html tag canvas
Similar as altering in browser

i strive name funtions


however totally different contact place…

cocos creator 2.4.8 model

Are you able to present me with a demo?


ios cellphone (me iphone14 professional), panorama

ios safari full display screen downside

check url

  1. change panorama mode
  2. drag up (scroll up) → Cover Handle Bar

portrait button – okay
panorama button – not working

I commented on the publish.
Please verify.

Hello, by way of your check hyperlink, I can reproduce your downside, this downside, are you able to present a check venture?



Please enter your comment!
Please enter your name here

Most Popular

Recent Comments

Arnavsijapati on Planet of Lana – Beta Demo
Jai Kishor Upadhyay on Planet of Lana – Beta Demo