Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Programming and Scripting
Display/ Print Screen Resolution

j0linar
Registered User
Quote
2017-02-07 17:56:25

Is there a way to define a var for the screen resolution?
What i would like to do is to print/ output the current screen resolution onto a 2d Overlay.

What i did so far was to dismantle http://www.ambiera.com/forum.php... the realtime Skybox by just_in_case

i tried canvas/resolution ... but noone of those exist as functions.
So what is the function called for Canvas/Screen resolution?


just_in_case
Moderator
Quote
2017-02-07 20:26:51

I don't think it is yet supported... You cant just capture the whole screen and display it on a 2d overlay .... Till someone had made such a behaviour or action for that...


But if you want to show up a mini game in your original game..

For example your player reaches to a gaming machine or t.v model and then just press a button to play mini game...

For that i will suggest you to scale down the whole mini game scene.. and draw it on th t.v screen of you gaming model
...

I know you wont understand what am trying to say...

Actually all you have to do is to scale down the whole scene (minimize it) and put it into a bounding box...
And then recreate your original game in the same scene with large models and textures outside that bounding box...


j0linar
Registered User
Quote
2017-02-07 21:53:19

ooh no looks like i choose the wrong wording
what i wanted is to display the current screen resolution in numbers like you did in the realtime Skybox with time/date...


just_in_case
Moderator
Quote
2017-02-08 04:18:22

Ohh yeah... Well maybe then this will work...


Var resoulution = screen.width+"x"+screen.height;
Var overlay = CcbGetscenenodefromname("2d overlay");
Ccbsetscenenodeproperty (overlay, "Draw Text", True);
Ccbsetscenenodeproperty (overlay,"Text", resolution);


Not sure but maybe this will print the current screen height and width of your device.. on a 2d overlay...

Hope it will work for you...!

[b]Edit:-[b] Or maybe
    ccbGetScreenWidth
ccbGetScreenHeight

this can Help You...


j0linar
Registered User
Quote
2017-02-08 21:15:32

hey thx


//Draw Screen Res
var s = ccbGetSceneNodeFromName("Screen");
var text = ccbGetSceneNodeProperty(s, "Text");
ccbSetSceneNodeProperty(s, "Text",''+ccbGetScreenWidth()+'X'+ccbGetScreenHeight());


This worked perfectly to output the current Screen height/width


j0linar
Registered User
Quote
2017-02-11 13:19:25

hey just_in_case
hope you could help me out once more, how would i specify/change the resolution.

So when i click on lets say Screen it displays a list of resolutions defined by me and if i pick one it switches to it.... and is there a option to set it fullscreen/windowed by script?


just_in_case
Moderator
Quote
2017-02-12 08:24:00

You can't change the resolution of client system using javascript but maybe there is a way to change the resolution of your exe.

you have to ask @Niko(developer).. if there exist a function like ccbSetScreenWidth() and ccbSetScreeHeight() ...?


j0linar
Registered User
Quote
2017-02-13 12:40:37

Thanks just_in_case
i asked niko on steam and he confirmed that there will be a update in about 2 weeks that will include features to set Screen size along with toggling fullscreen

http://steamcommunity.com/app/36...


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "I?ternational" (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