This library was basically taken straight from the Handy Stuff library so it's not really new (well, it's new to everyone who isn't familiar with that other library, which is most people). I added a little bit to it, but I figured I'd make a standalone library out of it. I've found that this feature is something I often use and it makes more sense to be able to include just this feature instead of including the entire Handy Stuff library.
Also, I think it'd be neat to have a library for every letter of the alphabet and O wasn't covered. H is already covered by HUD Groups so I could stand to get rid of Handy Stuff.
Overlaysby Forum_account |
||
An easy way to manage and manipulate overlays. [More] |
To download this library for your Linux/Mac installation, enter this on your command line:
DreamDownload byond://Forum_account.Overlays##version=8 Emulator users, in the BYOND pager go to File | Open Location and enter this URL:byond://Forum_account.Overlays##version=8 |
BYOND's overlays are very useful but sometimes they're not easy to work with. It's easy to add an overlay to the player's list of overlays, but once you've done that it can be hard to update the overlay. It's easy to add overlays for the mob's shirt, shoes, pants, and hat, but it's not always easy to remove just their shoes overlay or change the icon state of their hat.
This library makes those things really easy. First, it provides the overlay() proc which is used to create overlays. The proc belongs to the atom, so you just call it for the mob you're adding an overlay to:
mob.overlay("hat")
That'll add an overlay whose icon matches the mob's icon and has the "hat" icon state. This proc creates the overlay, adds it to the mob's list of overlays, and more importantly it returns an Overlay object. This object is defined by the library and is how you can easily manipulate overlays. Just keep a reference to this object and you can do some handy things, for example: mob Version HistoryVersion 7 (posted 06-09-2012)
|
Please support BYOND through Membership or a donation!
|
Related Libraries
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
More Libraries by Forum_account
|
Copyright © 2024 BYOND Software.
All rights reserved.
hat = overlay("hat")
The hat will be created as an overlay. If you do this:
The hat will be converted to an image object that's only visible to its owner. You can let more people see the hat by calling the ShowTo() proc again.
This all happens inside the library. You don't have to be aware of the images and overlays lists. It's all handled by the same /Overlay object and you use the same set of procs (ex: Icon, IconState, Layer, PixelX, PixelY, etc.) to modify it whether it's being handled internally as an overlay or image object.