Thread Rating:
  • 1 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Release 2.9.0 - World mode
#1
Hi folks,

I've just pushed Release 2.9.0 to GitHub. This release adds a new feature called "World mode", where all the layers contained in a single .tmx file and any selected sprites are updated when the "world position" changes. Layers take into account the parallaxing factor recently introduced in Tiled editor, as well as offset values, visibility and transparency. And sprites take their "world position" and have them automatically converted into screen coordinates.

This mode simplifies greatly the setup of a whole level (just a single call). And updating the whole playfield, that previously required one call per layer and per sprite, and keeping track of their positions, now is done with another single call.

The documentation is already online, here it is the new section:
http://www.tilengine.org/doc/md_world.html

"Classic" mode continues working, so old samples and projects won't break, but new ones can benefit from this "world" feature.
#2
Oh wow, this sounds like a very nice, and much needed update! It couldn't have came at a better time, as I've been racking my brain trying to figure out this exact problem for weeks now, lol. Can't wait to try it out. Thank you for your continued support of Tilengine and all these wonderful updates you're putting out that make Tilengine that much easier to use. Much appreciation for the time you put into this project. I'm looking forward to many more improvements and features in the future. Keep it up!
#3
Hi!
Thanks for your encouraging words Smile knowing that there are people like you following it with interest is very satisfying.
This update isn't yet finished, I have to build and deploy all binaries to itch.io and create a development blog entry, but at lest you can get the sources at github.

I have more ideas to implement, I expect to be more active in the following weeks!

Regards,
#4
Hey Marc, I'm running into an issue with loading a tmx file with the new TLN_LoadWorld function. I'm getting an Invalid Tileset reference error. The tmx file works fine with the old TLN_LoadTilemap function, but when I try to use it with the new function it won't work. Could you take a look at the tmx file and tell me what's wrong?

Thanks!
#5
Hi,

Assets you provided are incomplete. Files Forest_BG1.png and Forest_BG2.png are missing. Tiled editor itself complains about them. And having an object layer without any bitmap-based tileset is causing the Tileset reference error.

However the file gets actually loaded and partially displayed, but you're looking the top left corner of the map, that has a solid region of gray tiles that seems "empty" but it isn't.

Let me know,
#6
Hey, thanks for checking that out for me. It was the empty object layer as you said. Got it working now.

One more question: is it possible to toggle the visibility of certain layers on and off when using world mode? Like for instance, say I have two or more layers each with different bitmaps and I wanted to switch to a different background image for a section of the world, is there a function to do such a thing?
#7
Hi,

Good question. World mode is recent and the feature you suggest isn't implemented. You can use TLN_DisableLayer() to turn off a layer, but then you have to reconfigure it to enable it again, that kills the idea behind "world mode".

However it would be quite trivial to implement a TLN_EnableLayer() that just re-enables the layer with previous parameters. That's what you need. Expect a release 2.9.1 soon Smile
#8
(03-19-2021, 10:22 PM)megamarc Wrote: Hi,

Good question. World mode is recent and the feature you suggest isn't implemented. You can use TLN_DisableLayer() to turn off a layer, but then you have to reconfigure it to enable it again, that kills the idea behind "world mode".

However it would be quite trivial to implement a TLN_EnableLayer() that just re-enables the layer with previous parameters. That's what you need. Expect a release 2.9.1 soon Smile

Hey that's great to hear! I was thinking it would be nice if we had a TLN_GetWorldPosition() function as well. 

I've been trying to figure out how to set a raster effect for line scrolling, but only when the world is at a certain position, and currently I don't see any way to do this without such a function. For example only apply linescroll to the layer if world position y is < 100.
#9
Hi!
I understand. Right now you can keep track of the world position yourself, storing it in a variable inside your program so it's always available. But I can add a TLN_GetWorldPosition() of course.


Forum Jump:


Users browsing this thread: 1 Guest(s)