Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Help with CopperCube
How to set screen width/height?

Alireza
Guest
Quote
2023-01-03 16:43:59

I know that there is a command:
CcbGetScreenWidth();

But there is not a command :
CcbSetScreenWidth();


Guest
Guest
Quote
2023-01-03 19:07:21

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.


Alireza
Guest
Quote
2023-01-03 20:13:58

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


Guest
Guest
Quote
2023-01-03 21:12:08

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.


Alireza
Guest
Quote
2023-01-03 21:52:19

Thank you
I will try it


just_in_case
Moderator
Quote
2023-01-04 10:38:19

It seems that you want to do it for webGL games and I already texted you an answer for that on my Discord server.


alireza
Guest
Quote
2023-01-04 13:43:11

@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:

🔎︎



alireza
Guest
Quote
2023-01-04 13:45:16

i think the second image did not upload in previous post correctly. i put link again:
🔎︎



Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Int?rnational" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact