Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
I know that there is a command: CcbGetScreenWidth(); But there is not a command : CcbSetScreenWidth(); |
||||
|
From what I see you would need to use a workaround to change the screen resolution during runtime. You can make different ccb files with different resolutions and switch between them. The problem with this is it drastically increases the size in mbs of your project. On Just_In_Case's site there is this Game Launcher: https://neophyte.cf/ccb_source_e... I believe that template will show you how to do the method I described above. Perhaps in the update there will be a new function to change the resolution, but I am not sure. |
||||
|
Thank you. But i want to get width/height devices (smart phones) screen , and then set the game width/height adjust to it. I can "get" the width/heghit but can not set the game width/height to it |
||||
|
Yeah that's what I am telling you. There is no way to set it in the JS API that comes with CopperCube. If you're working with WebGL, you can try using the CopperLicht API. https://www.ambiera.com/copperli... It may or may not be possible with that; I've not used it before. |
||||
|
Thank you I will try it |
||||
|
It seems that you want to do it for webGL games and I already texted you an answer for that on my Discord server. |
||||
|
@just_in_case I tried this code first in one behavior and it was able to get the width and height of the device (smartphone): Now I don't know how to use it in HTML codes. I tried this but it didn't work: |
||||
|
i think the second image did not upload in previous post correctly. i put link again: |
|