fixed resolution & fit to screen

Hello
I want to my app will render to fixed resolution (f.e. 800x600) then scale render result to fit to window
how to?
Has invited:

QC-Cindy

Favor from:

hello, you can do this just like http://docs.qiciengine.com/man ... .html

elmigo

Favor from:

this solution for ui only not for whole game
in the phaser my code look like next
game = new Phaser.Game({width:800, height:600, state:create});
function create() {
game.scale.scaleMode = Phaser.ScaleManager.EXACT_FIT;
}
i tried make node with awake function that set width, height & scaleMode but dont find how to access to game app
 

eric

Favor from:

OOX1QD~(UBO]{BDSTFUYV@I.jpg

 

elmigo

Favor from:

scale adapter dont scale stage, UI only

elmigo

Favor from:

sorry for my english
how apply SA to stage?

eric

Favor from:

Normally ScaleAdapter will be used in UIRoot component that is the root in the scene, you can put all nodes under it. We introduce Rect Transform layout that is much more advance than tradictional layout, so i suggest you try to learn Rect Transform layout and use ScaleAdapter to do the job Phaser.ScaleManager does.

elmigo

Favor from:

you can put all nodes under it.


i tried this already on AccelerateToPoint project.
I moved the arrow node to UIRoot & arcade phys worked wrong then

eric

Favor from:

AccelerateToPoint.prototype.update = function() {
    var self = this;
    var point = self.gameObject.parent.toLocal(self.game.input.cursorPosition);
    self.gameObject.rotation = this.rigidbody.moveToObject(point, self.speed,self.maxTime);
};
You should change the AccelerateToPoint demo's script to like above, that's this demo's issue, Arcade Physics works well with UIRoot 

elmigo

Favor from:

yes, this helped, thanks, but...
next screen said that qici has stage size as big as window viewport size
elmigo.ru/screenshots/scrshot_111.png
CPU consumption of published app say to me same too
i want render 640x480 sized stage then stretch its to canvas size, like Phaser.ScaleManager.EXACT_FIT mode



 

eric

Favor from:

You should let the white background(UIImage) to fill the UIRoot, make its anchor min to (0, 0) and max to (1, 1)You can also add me to chat (skype:eric_9948)

Screen_Shot_2016-01-20_at_9.32_.03_PM_.png

 

elmigo

Favor from:

thanks for new demo fixed_size

To reply to a question, please Login or registered