Ambiera Forum

Discussions, Help and Support.

Create a new account, Search, or Login:
Name: Password:
Ambiera Forum > CopperCube > Programming and Scripting
Change the dimensions of 2Doverlays with resolution of the device?
Author Text

misterpaint
Registered User
Quote
2022-08-12 11:41:56

well.. I have create an interface for my project in CC6.
There are 4 arrows (right, left, up, down), on pc is ok, on smartphone orizontally mode is ok, but in smartphone vertical mode the arrows are too little.

There is a possibility by script to change dimension of these with the resolution of the device?

Example, if this is orizontally or vertically?


pmax
Registered User
Quote
2022-08-12 15:19:31

@misterpaint
instead of using a 2Doverlays try using a 2Dimput then set it as a keypress emulator.
That should work is to try.


just_in_case
Moderator
Quote
2022-08-13 04:00:26

@pmax, I don't think the op has an issue with triggering of click events of overlays, so maybe key emulation is not what he wants..

@misterpaint, well, I am not sure if you are using native android export or the webGL one.
But if you are using the webGL one then yeah you can resize the overlays and can also adjust their positions.

also id you are using 2D touch input then it won't work as 2D touch input doesn't work properly on the basis of scale and alignment on webGL platform.

you can get the device orientation and based on the orientation you can change the scale of the overlays.


pmax
Registered User
Quote
2022-08-13 11:13:34

@just_in_case I suggested using 2Dinput because I noticed it has the "Maintain proportions" command, I don't know maybe that's what they need to solve the problem?


just_in_case
Moderator
Quote
2022-08-13 11:29:15

@pmax, yeah general 2D overlays also have that "keep aspect ratio" command as well, but that works to keep the image texture in the aspect ratio and won't affect the scale of the overlay or touch input.


pmax
Registered User
Quote
2022-08-13 11:48:32

@just_in_case thanks for the 'information.


DouweDabbe
Guest
Quote
2022-08-14 02:09:19

or
make interface / gui in rocketcake first and
easyly test various layouts for your GUI for
PC / Tablet / small and large phones

then when happy
export entire GUI as single image
put that in your app and combine with 2d elements for
info outputs and command interactivity

that way 3 scenarios will fit game to any device
if os windows and screen with > 800px = PC
if os android then phone or tablet
screenheight > screenwidth = phone portretmode


Aiming_bullets
Guest
Quote
2022-08-14 08:02:55

@Douwedabbe, I beleive you never tried that yourself, that will simply again put the op in the same situation and would just be waste of time..
cause in the end he has to use 2D overlays to put the image created from rocketcake or any other tool, that leads him to the same situation, because he is already using 2D overlays.

it would be of much better if you try things first yourself and then post the answers, otherwise it will just waste time and make the original author frustrated.

It wasted my time and I hope it won't waste time of the OP, because it doesn't work and simply put more effort and make the problem overcomplicated.

if you don't know the solution then it's better not to provide those overcomplicated stuff that don't work at all.


just_in_case
Moderator
Quote
2022-08-14 08:07:41

If the game is in webGL then you can check the Orientation and based on the orientation you can change the scale of the overlays. Or you can create 2 instance of the overlays one with a small scale and one with large scale and then yous still need to check the orientation and then hide or unhide one instance if the overlays..


misterpaint
Registered User
Quote
2022-08-15 01:16:38

I'm sorry for delay.. but I'm with covid... it's my 2nd time with covid... this variant is terrible :(
I will read your answers calmly, thank you very much and see you soon.. I hope.. :D


just_in_case
Moderator
Quote
2022-08-16 08:30:23

that's terrible man, please take care of yourself and get well soon...


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "?nternational" (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© 2020 Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact