Is there a way to display an atom's bounds? I tried to use DrawBox() but it didn't work well, so I wondered what should I do to draw something on an atom's bounds so I can properly see how far it goes.
Thank you :)
![]() Nov 17 2013, 2:04 am
|
|
DrawBox should work. Maybe you used it incorrectly?
|
There are actually several ways you could go about doing this. First, you could use draw box, but that would require a blank icon being rescaled, and then a box being draw on it. Which isn't very efficient. Another option is to Scale() the icon, which "should" be more efficient than scaling and drawing, but don't hold me to that (I have not run any tests).
The option that I feel is best, is to utilize BYOND's new matrix datum. The matrix is a datum used to manipulate icons through the transform variable (every atom has it). With transform, you can scale and rotate icons without creating cache (files that players must download in the middle of the game). Not only does matrix help to prevent unwanted cache, but it also seems to be much more efficient than icon manipulation. However, it is limited so icon manipulation is still needed in some cases. Now that I've given a long winded rant to justify this script, here ya go: mob/verb/Bounds() *EDIT* The script I've provided is designed for square blocks, you will need to make alterations if you wish to have rectangles. Also, be sure that the icons are correctly sized when you create them, elsewise the system will be faulty and your display wont be accurate. |