0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

scaleX,scaleYに対する処理

0
Posted at

scaleX,scaleY

enchant.jsでは画像の大きさをX軸、Y軸に倍率をかけることができる。

しかしながら1.5倍などと定数で指定してしまうと、画面サイズに応じて大きさが異なってしまう。

だが、https://qiita.com/takoyaki_vs_okonomiyaki/items/716871bc08e7e1290f7f
でも書いた通りwindow.innerWidth/4などで指定すれば画面サイズに対応できる。


変数名.scaleX = window.innerWidth / 400;
変数名.scaleX = window.innerHeight / 400;

しかし、これが難しく画面の縦横比に合わせた画像でないとこの方法では思い通りに動かない。

その場合どうするかというのは各画面サイズに合わせた画像を用意するしかないと思う。

一括サイズ変換などのツールが調べたらあるので使ってみてください。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?