Is there a way to define the width of the screen with a variable???

Is there a way to define the width of the screen with a variable?

For example:

Var Width = [Variable defining any given screen width];

The width and height of your screen is set by microStudio, which can change when you enlarge or shrink the window the game operates in. You can't set them, but you can read them with screen.width and screen.height. There are a couple of things you can rely on. The smaller of the two sizes, screen.width or screen.height, will be 200. the larger will be a value scaled to match the window aspect ration.

You can force the aspect ration in settings, that will give you a reliable width if you need that. Better if you can read the screen width and work with that.

I have learned that the 200px dimension is really a fractional number and not a screen pixel value, that is it can be a real number in practice. The studio will scale that value up when you enlarge the window.

Post a reply



Validate your e-mail address to participate in the community