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)

Addition)

I Need Div’s contact Occasion → ship Cocos Creator

code not working.

perform ProcTouch(evt){
let cv = doc.getElementById(“GameCanvas”);
cv.fashion.width = window.innerWidth+‘px’;
cv.fashion.peak = window.innerHeight+‘px’;
cv.dispatchEvent(evt);
}
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.

thanks
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

cc.view.setFrameSize(window.innerWidth,window.innerHeight);
cc.view.setCanvasSize(window.innerWidth,window.innerHeight);

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

cc.view.setCanvasSize(window.innerWidth,window.innerHeight);
cc.view._resize();
cc.inner.inputManager._updateCanvasBoundingRect();
cc._widgetManager.onResized();

however totally different contact place…

cocos creator 2.4.8 model

Are you able to present me with a demo?

setting

ios cellphone (me iphone14 professional), panorama

ios safari full display screen downside

check url
http://grapegaming.synology.me:22780/full/

  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?

RELATED ARTICLES

LEAVE A REPLY

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