Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TiledMap如何在渲染区域滚动 #19

Open
chaoslife opened this issue Oct 25, 2016 · 1 comment
Open

TiledMap如何在渲染区域滚动 #19

chaoslife opened this issue Oct 25, 2016 · 1 comment

Comments

@chaoslife
Copy link

刚使用上TileMap库,没有找到移动地图的API,
我按照例子已经初始化出来地图并显示了

            var data: any = egret.XML.parse(e.currentTarget.response);

            this._tileMap = new tiled.TMXTilemap(400, 600, data, this._url);

            this._tileMap.render();
            this.addChild(this._tileMap);

设定的渲染区域为400x600。我没有找到移动地图的方法,请问如果要移动地图该使用什么方法,在哪个类下呢?(移动x,y,会把渲染区域也跟着移动)

读了下Tiled.js,没有找到offset的方法,draw方法都是x0, y0开始画的

PS: 如果把render width & render height设成图片的大小,那么渲染区域都变很大了,需求只想在比如 200 x 200的区域渲染

@HANKM3NG
Copy link

HANKM3NG commented Aug 8, 2018

把map包在一个自己画的指定尺寸的shape里试试

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants