Using device width to set actor width
imjustmike
Member Posts: 450
Hey guys,
I'm playing around with a few different techniques to try and build a single app that seamlessly works across devices without cropping etc. I do this sort of thing with responsive web design, making sites look different depending on the screen size.
The one thing I'm trying to do at the moment is to get the actor to be 100% of the width of the device. I'm currently using a change attribute behaviour to change self.width to game.screen.size.width - seems common sense enough. But, when previewing it, the actor's width is only half the screen size. I've tested it using a display text to show the current width, and true enough, it's exactly half the width. Is there any reason for this?
I'm currently building in ipad portrait mode.
I'm playing around with a few different techniques to try and build a single app that seamlessly works across devices without cropping etc. I do this sort of thing with responsive web design, making sites look different depending on the screen size.
The one thing I'm trying to do at the moment is to get the actor to be 100% of the width of the device. I'm currently using a change attribute behaviour to change self.width to game.screen.size.width - seems common sense enough. But, when previewing it, the actor's width is only half the screen size. I've tested it using a display text to show the current width, and true enough, it's exactly half the width. Is there any reason for this?
I'm currently building in ipad portrait mode.
Comments
Seems strange behaviour for the viewer to work like that though...