简体   繁体   中英

Tiled Java & Parallax

Does anyone know how the provisional support for parallax layers in the GitHub Java version of Tiled works properly?

It compiles, and it executes fine. However, if I set a layer to viewplane distance 0.00 (the minimum) and the eye-viewplace distance to 0.00, I would expect the yellow rectangle which represents the game's viewport to scroll 1:1 with the editor view. It does not, and scrolling all the way to the left of the editor view results in the yellow 'viewport' rectangle being half off of the screen.

Am I misunderstanding the tool, or is it not in a working state? If I can understand it, then extending Slick2D's TiledMap class to render the layers with parallax depth should be trivial.

Upon closer inspection of the code it appears that the author intending for the origin of the parallax to be the center of the map. This is problematic because it causes the issue described above, so I rewrote it such that the viewport is always bound to the 0.00 viewplane.

If anyone is interested in the code, reply to this answer and I'll make it available.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM