Turf Edges

by Forum_account
[Share] [Zip]
To download this demo for your Linux/Mac installation, enter this on your command line:

DreamDownload byond://Forum_account.TurfEdges##version=2

Emulator users, in the BYOND pager go to File | Open Location and enter this URL:

byond://Forum_account.TurfEdges##version=2

186 downloads
Version 2
Date added: Feb 11
Last updated: Feb 15
6 fans
Turf Edges
Automatically generates edge icons for turfs and places them on the map. [More]
This demo contains code to generate edge icons for turfs and to automatically place them on the map. It generates an 8-directional edge icon for each icon state. You can specify a custom mask icon to determine how exactly one turf will blend into the next.

Here's an example. This is the map without edges:



And this is the same map with the edges generated by this demo:



All you have to do is generate the edge icon state and set the edge_layer var for each turf.

Advertisement

Comments

Forum_account: (Feb 15, 10:06 am)
I just updated the demo to change the way edges are added. The old code is still in there, it's just commented out, in case you want to use the old method. The change removes some redundant edges, for example:

   +---+
| 1 |
+---+
| 2 |
+---+

If you're adding edges around both of those tiles, turf 1 would get edges on 7 sides (all but south) and turf 2 would get edges on all sides but north. The northeast overlay added to turf 2 would overlap turf 1's southeast overlay.

With this update, turf 1 would only get 5 edges (west, northwest, north, northeast, and east) so it doesn't have any overlays that overlap turf 2's edge overlays.

Kisioj wrote:
Forum_account, you are doing fantastic job! Whenever I look for some new and good quality libraries and demos, I first go there: http://www.byond.com/members/Forumaccount?tab=creations

Thanks! That's always good to hear =)
Yut Put: (Feb 13, 5:11 pm)
Kisioj wrote:
Forum_account, you are doing fantastic job! Whenever I look for some new and good quality libraries and demos, I first go there: http://www.byond.com/members/Forumaccount?tab=creations


For a while, chrome had it cached so that if I typed in BYOND and pressed enter on the search bar his site was the first place I'd go, lol
RoffleBunny: (Feb 12, 8:02 pm)
So beautiful like most of your contributions, forum_account. Thank you.
Kisioj: (Feb 12, 5:47 pm)
Forum_account, you are doing fantastic job! Whenever I look for some new and good quality libraries and demos, I first go there: http://www.byond.com/members/Forumaccount?tab=creations

Forum_account: (Feb 11, 6:14 pm)
Branks wrote:
Dude. You are a savior. This is very useful for a project I'm working on.

Glad to hear!